feat : new ui and fix bug's
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
@@ -17,7 +18,7 @@ class SaleLogic extends GetxController {
|
||||
StewardRootLogic rootLogic = Get.find<StewardRootLogic>();
|
||||
|
||||
List<String> routesName = ['فروش'];
|
||||
|
||||
DateTime? _lastBackPressed;
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
@@ -114,4 +115,23 @@ class SaleLogic extends GetxController {
|
||||
rootLogic.inventoryExpandedList.clear();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
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