改为null的形式
This commit is contained in:
@ -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
|
||||
|
@ -24,13 +24,11 @@ class _ActionPanelState extends State<ActionPanel> {
|
||||
final DynamicsController _dynamicsController = Get.put(DynamicsController());
|
||||
late ModuleStatModel stat;
|
||||
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
|
||||
|
@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -135,13 +137,11 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
late String memberHeroTag;
|
||||
late bool enableAi;
|
||||
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
|
||||
|
@ -48,13 +48,11 @@ class _ZanButtonState extends State<ZanButton> {
|
||||
}
|
||||
}
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user