feat : new ui and fix bug's
This commit is contained in:
@@ -15,6 +15,7 @@ import 'package:rasadyar_chicken/presentation/pages/steward/home/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/steward/sale/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/steward/segmentation/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -157,12 +158,36 @@ class StewardRootLogic extends GetxController {
|
||||
);
|
||||
}
|
||||
|
||||
void onPopScopTaped() async {
|
||||
final nestedKey = Get.nestedKey(currentPage.value);
|
||||
final currentNavigator = nestedKey?.currentState;
|
||||
int getNestedKey() {
|
||||
switch (currentPage.value) {
|
||||
case 0:
|
||||
return stewardFirstKey;
|
||||
case 1:
|
||||
return stewardSecondKey;
|
||||
case 2:
|
||||
return stewardThirdKey;
|
||||
|
||||
case 3:
|
||||
return stewardFourthKey;
|
||||
|
||||
case 4:
|
||||
return stewardFourthKey;
|
||||
|
||||
default:
|
||||
return stewardThirdKey;
|
||||
}
|
||||
}
|
||||
|
||||
void onPopScopTaped() async {
|
||||
final nestedKeyId = getNestedKey();
|
||||
GlobalKey<NavigatorState>? currentNestedKey = Get.nestedKey(nestedKeyId);
|
||||
|
||||
fLog("onPopScopTaped ==> ${currentNestedKey?.currentState?.canPop()}");
|
||||
if (currentNestedKey?.currentState?.canPop() == true) {
|
||||
iLog(currentNestedKey?.currentState?.canPop());
|
||||
iLog(currentNestedKey?.currentContext );
|
||||
currentNestedKey?.currentState?.popUntil((route) => route.isFirst);
|
||||
|
||||
if (currentNavigator?.canPop() ?? false) {
|
||||
currentNavigator?.pop();
|
||||
} else {
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
|
||||
Reference in New Issue
Block a user