feat: new ui (#1455)

This commit is contained in:
Levi authored and GitHub committed 2026-09-05 19:53:41 +08:00
1 parent 3be8db664c
commit 177c225f16
742 files changed
+59951 -5934

No files matched your search

@@ -0,0 +1,24 @@
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import '../../l10n/l10n.dart';
import '../widgets/app_toast.dart';
class AppExitConfirmationController {
static const confirmationWindow = Duration(seconds: 2);
DateTime? _lastBackAt;
Future<void> handleBack(BuildContext context) async {
final now = DateTime.now();
final lastBackAt = _lastBackAt;
if (lastBackAt != null && now.difference(lastBackAt) <= confirmationWindow) {
_lastBackAt = null;
await SystemNavigator.pop();
return;
}
_lastBackAt = now;
showAppToast(context, context.l10n.pressBackAgainToExit);
}
}