feat : auth live stock
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||
|
||||
class RootLogic extends GetxController {
|
||||
List<Widget> pages = [
|
||||
MapPage(),
|
||||
Navigator(
|
||||
key: Get.nestedKey(0),
|
||||
initialRoute: LiveStockRoutes.requests,
|
||||
@@ -22,7 +23,7 @@ class RootLogic extends GetxController {
|
||||
}
|
||||
},
|
||||
),
|
||||
MapPage(),
|
||||
|
||||
ProfilePage(),
|
||||
];
|
||||
RxInt currentIndex = 1.obs;
|
||||
|
||||
@@ -9,7 +9,6 @@ class RootPage extends GetView<RootLogic> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ObxValue((currentIndex) {
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
@@ -43,28 +42,39 @@ class RootPage extends GetView<RootLogic> {
|
||||
index: currentIndex.value,
|
||||
sizing: StackFit.expand,
|
||||
),
|
||||
extendBody: true,
|
||||
|
||||
bottomNavigationBar: RBottomNavigation(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
items: [
|
||||
RBottomNavigationItem(
|
||||
icon: Assets.vec.filterSvg.path,
|
||||
label: 'درخواستها',
|
||||
isSelected: currentIndex.value == 0,
|
||||
onTap: () => controller.changePage(0),
|
||||
),
|
||||
|
||||
RBottomNavigationItem(
|
||||
icon: Assets.vec.mapSvg.path,
|
||||
label: 'نقشه',
|
||||
icon: Assets.vec.mapSvg.path,
|
||||
isSelected: currentIndex.value == 0,
|
||||
onTap: () {
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'درخواستها',
|
||||
icon: Assets.vec.settingSvg.path,
|
||||
isSelected: currentIndex.value == 1,
|
||||
onTap: () => controller.changePage(1),
|
||||
onTap: () {
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
|
||||
RBottomNavigationItem(
|
||||
icon: Assets.vec.profileUserSvg.path,
|
||||
label: 'پروفایل',
|
||||
icon: Assets.vec.profileCircleSvg.path,
|
||||
isSelected: currentIndex.value == 2,
|
||||
onTap: () => controller.changePage(2),
|
||||
onTap: () {
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
|
||||
controller.changePage(2);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user