feat: killHouse action page
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/common/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class KillHouseRootLogic extends GetxController {
|
||||
RxInt currentPage = 2.obs;
|
||||
|
||||
final pages = [
|
||||
Navigator(
|
||||
key: Get.nestedKey(killHouseFirstKey),
|
||||
onGenerateRoute: (settings) {
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () =>
|
||||
ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.actionKillHouse),
|
||||
);
|
||||
|
||||
return buildRouteFromGetPage(page);
|
||||
},
|
||||
),
|
||||
Container(color: Colors.deepPurpleAccent.withAlpha(50)),
|
||||
ProfilePage(),
|
||||
];
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void changePage(int i) {
|
||||
currentPage.value = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class KillHouseRootPage extends GetView<KillHouseRootLogic> {
|
||||
const KillHouseRootPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ObxValue((data) {
|
||||
return ChickenBasePage(
|
||||
isBase: true,
|
||||
isFullScreen: true,
|
||||
scrollable: true,
|
||||
child: Stack(
|
||||
children: [
|
||||
IndexedStack(children: controller.pages, index: data.value),
|
||||
Positioned(
|
||||
right: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
child: RBottomNavigation(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
items: [
|
||||
RBottomNavigationItem(
|
||||
label: 'عملیات',
|
||||
icon: Assets.vec.settingSvg.path,
|
||||
isSelected: controller.currentPage.value == 0,
|
||||
onTap: () {
|
||||
/* Get.nestedKey(
|
||||
poultrySecondKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(
|
||||
poultryFirstKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);*/
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'خانه',
|
||||
icon: Assets.vec.homeSvg.path,
|
||||
isSelected: controller.currentPage.value == 1,
|
||||
onTap: () {
|
||||
/* Get.nestedKey(
|
||||
poultryFirstKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(
|
||||
poultryThirdKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);*/
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'پروفایل',
|
||||
icon: Assets.vec.profileCircleSvg.path,
|
||||
isSelected: controller.currentPage.value == 2,
|
||||
onTap: () {
|
||||
/* Get.nestedKey(
|
||||
poultryFirstKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(
|
||||
poultrySecondKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);*/
|
||||
controller.changePage(2);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}, controller.currentPage);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user