feat : request tagging and fix chips and fix overflow module in auht

This commit is contained in:
2025-05-24 15:12:40 +03:30
parent 10cb9d1f52
commit 276c8dd1fe
12 changed files with 450 additions and 264 deletions

View File

@@ -1,11 +1,30 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_livestock/presentation/page/action/view.dart';
import 'package:rasadyar_livestock/presentation/page/map/view.dart';
import 'package:rasadyar_livestock/presentation/page/profile/view.dart';
import 'package:rasadyar_livestock/presentation/page/request_tagging/view.dart';
import 'package:rasadyar_livestock/presentation/page/requests/view.dart';
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
class RootLogic extends GetxController {
List<Widget> pages = [ActionPage(), MapPage(), ProfilePage()];
List<Widget> pages = [
Navigator(
key: Get.nestedKey(0),
initialRoute: LiveStockRoutes.requests,
onGenerateRoute: (settings) {
switch (settings.name) {
case LiveStockRoutes.requests:
return GetPageRoute(page: () => RequestsPage());
case LiveStockRoutes.requestTagging:
return GetPageRoute(page: () => RequestTaggingPage());
default:
return GetPageRoute(page: () => RequestsPage());
}
},
),
MapPage(),
ProfilePage(),
];
RxInt currentIndex = 1.obs;
@override
@@ -21,5 +40,4 @@ class RootLogic extends GetxController {
}
void changePage(int i) => currentIndex.value = i;
}

View File

@@ -9,36 +9,65 @@ class RootPage extends GetView<RootLogic> {
@override
Widget build(BuildContext context) {
return ObxValue((currentIndex) {
return Scaffold(
body: IndexedStack(
children: controller.pages,
index: currentIndex.value,
sizing: StackFit.expand,
),
return PopScope(
canPop: false,
onPopInvokedWithResult: (didPop, result) {
final navigatorKey = Get.nestedKey(currentIndex);
eLog('Pop invoked with result: $result, didPop: $didPop');
navigatorKey?.currentState?.pop();
bottomNavigationBar: BottomNavigation1(
items: [
BottomNavigation1Item(
icon: Assets.vec.filterSvg.path,
label: 'درخواست‌ها',
isSelected: currentIndex.value == 0,
onTap: () => controller.changePage(0),
),
BottomNavigation1Item(
icon: Assets.vec.mapSvg.path,
label: 'نقشه',
isSelected: currentIndex.value == 1,
onTap: () => controller.changePage(1),
),
/*eLog('Pop invoked with result: $result, didPop: $didPop');
iLog(Get.currentRoute);
iLog(Get.previousRoute);
BottomNavigation1Item(
icon: Assets.vec.profileUserSvg.path,
label: 'پروفایل',
isSelected: currentIndex.value == 2,
onTap: () => controller.changePage(2),
),
],
final navigatorKey = Get.nestedKey(currentIndex);
if (currentIndex.value == 0 &&
navigatorKey != null &&
navigatorKey.currentState != null) {
if (navigatorKey.currentState!.canPop()) {
navigatorKey.currentState!.pop();
return;
}
if (!didPop) {
return;
}
}*/
},
child: Scaffold(
body: IndexedStack(
children: controller.pages,
index: currentIndex.value,
sizing: StackFit.expand,
),
bottomNavigationBar: BottomNavigation1(
items: [
BottomNavigation1Item(
icon: Assets.vec.filterSvg.path,
label: 'درخواست‌ها',
isSelected: currentIndex.value == 0,
onTap: () => controller.changePage(0),
),
BottomNavigation1Item(
icon: Assets.vec.mapSvg.path,
label: 'نقشه',
isSelected: currentIndex.value == 1,
onTap: () => controller.changePage(1),
),
BottomNavigation1Item(
icon: Assets.vec.profileUserSvg.path,
label: 'پروفایل',
isSelected: currentIndex.value == 2,
onTap: () => controller.changePage(2),
),
],
),
),
);
}, controller.currentIndex);