改为null的形式

This commit is contained in:
orz12
2023-12-23 15:49:04 +08:00
parent 0cf707b4c5
commit 25d32f8cc8
4 changed files with 22 additions and 28 deletions

View File

@ -122,13 +122,11 @@ class _BangumiInfoState extends State<BangumiInfo> {
late double sheetHeight;
int? cid;
bool isProcessing = false;
VoidCallback handleState(Future Function() action) {
return () async {
if (!isProcessing) {
setState(() => isProcessing = true);
await action();
setState(() => isProcessing = false);
}
void Function()? handleState(Future Function() action) {
return isProcessing ? null : () async {
setState(() => isProcessing = true);
await action();
setState(() => isProcessing = false);
};
}
@override