feat : new ui and fix bug's
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class BuyLogic extends GetxController {
|
||||
|
||||
List<String> routesName = ['خرید'];
|
||||
DateTime? _lastBackPressed;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -11,7 +12,7 @@ class BuyLogic extends GetxController {
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
fLog('BuyLogic onReady');
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@@ -20,4 +21,20 @@ class BuyLogic extends GetxController {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void onPopScopTaped() async {
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
_lastBackPressed = now;
|
||||
Get.snackbar(
|
||||
'خروج از برنامه',
|
||||
'برای خروج دوباره بازگشت را بزنید',
|
||||
snackPosition: SnackPosition.TOP,
|
||||
duration: Duration(seconds: 2),
|
||||
backgroundColor: AppColor.warning,
|
||||
);
|
||||
} else {
|
||||
await SystemNavigator.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user