37 lines
866 B
Dart
Executable File
37 lines
866 B
Dart
Executable File
import 'dart:async';
|
|
|
|
import 'package:get/get.dart';
|
|
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
|
import 'package:star_lock/tools/storage.dart';
|
|
|
|
class AboutConsole extends GetxController {
|
|
int _clickCount = 0;
|
|
Timer? _timer;
|
|
|
|
Future<void> handleTap() async {
|
|
_clickCount++;
|
|
|
|
if (_clickCount == 1) {
|
|
// 开始一个新的计时器
|
|
_timer = Timer(const Duration(seconds: 3), _resetCounter);
|
|
}
|
|
|
|
if (_clickCount >= 15) {
|
|
_timer?.cancel();
|
|
_resetCounter();
|
|
final bool? openDeBug = await Storage.getBool(isOpenDeBug);
|
|
if (openDeBug == true) {
|
|
DeBug.closeFloatWidget();
|
|
await Storage.setBool(isOpenDeBug, false);
|
|
} else {
|
|
DeBug.showFloatWidget();
|
|
await Storage.setBool(isOpenDeBug, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void _resetCounter() {
|
|
_clickCount = 0;
|
|
}
|
|
}
|