feat : change role navigation
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_core/core.dart' hide LinearGradient;
|
||||
|
||||
class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
@@ -43,7 +44,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
body: IndexedStack(
|
||||
children: [
|
||||
Navigator(
|
||||
key: Get.nestedKey(0),
|
||||
key: Get.nestedKey(stewardFirstKey),
|
||||
onGenerateRoute: (settings) {
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
@@ -54,7 +55,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
},
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(1),
|
||||
key: Get.nestedKey(stewardSecondKey),
|
||||
onGenerateRoute: (settings) {
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
@@ -66,15 +67,15 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
},
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(2),
|
||||
key: Get.nestedKey(stewardThirdKey),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(3),
|
||||
key: Get.nestedKey(stewardFourthKey),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]),
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(4),
|
||||
key: Get.nestedKey(stewardFifthKey),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]),
|
||||
),
|
||||
],
|
||||
@@ -88,7 +89,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
icon: Assets.vec.buySvg.path,
|
||||
isSelected: controller.currentPage.value == 0,
|
||||
onTap: () {
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardSecondKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
|
||||
controller.changePage(0);
|
||||
},
|
||||
@@ -98,7 +99,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
icon: Assets.vec.saleSvg.path,
|
||||
isSelected: controller.currentPage.value == 1,
|
||||
onTap: () {
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardFirstKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
@@ -107,8 +108,8 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
icon: Assets.vec.homeSvg.path,
|
||||
isSelected: controller.currentPage.value == 2,
|
||||
onTap: () {
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardSecondKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardFirstKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(2);
|
||||
},
|
||||
),
|
||||
@@ -117,8 +118,8 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
icon: Assets.vec.convertCubeSvg.path,
|
||||
isSelected: controller.currentPage.value == 3,
|
||||
onTap: () {
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardSecondKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardFirstKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(3);
|
||||
},
|
||||
),
|
||||
@@ -127,8 +128,8 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
icon: Assets.vec.profileCircleSvg.path,
|
||||
isSelected: controller.currentPage.value == 4,
|
||||
onTap: () {
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardSecondKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(stewardFirstKey)?.currentState?.popUntil((route) => route.isFirst);
|
||||
|
||||
controller.changePage(4);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user