mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: ActionItem (#974)
This commit is contained in:
committed by
GitHub
parent
fac37e59aa
commit
aaad7fc6dc
@@ -1,4 +1,4 @@
|
||||
import 'dart:async' show Timer;
|
||||
import 'dart:async' show FutureOr, Timer;
|
||||
|
||||
import 'package:PiliPlus/http/fav.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
@@ -38,6 +38,17 @@ abstract class CommonIntroController extends GetxController {
|
||||
|
||||
final Rx<List<VideoTagItem>?> videoTags = Rx<List<VideoTagItem>?>(null);
|
||||
|
||||
bool get hasTriple => hasLike.value && hasCoin && hasFav.value;
|
||||
|
||||
bool isProcessing = false;
|
||||
Future<void> handleAction(FutureOr Function() action) async {
|
||||
if (!isProcessing) {
|
||||
isProcessing = true;
|
||||
await action();
|
||||
isProcessing = false;
|
||||
}
|
||||
}
|
||||
|
||||
Set? favIds;
|
||||
final Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
|
||||
@@ -54,7 +65,7 @@ abstract class CommonIntroController extends GetxController {
|
||||
bool prevPlay();
|
||||
bool nextPlay();
|
||||
|
||||
void actionLikeVideo();
|
||||
Future<void> actionLikeVideo();
|
||||
void actionCoinVideo();
|
||||
void actionTriple();
|
||||
void actionShareVideo(BuildContext context);
|
||||
|
||||
Reference in New Issue
Block a user