import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; import 'logic.dart'; class RootPage extends GetView { const RootPage({super.key}); @override Widget build(BuildContext context) { return ObxValue((currentIndex) { return PopScope( canPop: false, onPopInvokedWithResult: (didPop, result) { final navigatorKey = Get.nestedKey(currentIndex); eLog('Pop invoked with result: $result, didPop: $didPop'); navigatorKey?.currentState?.pop(); /*eLog('Pop invoked with result: $result, didPop: $didPop'); iLog(Get.currentRoute); iLog(Get.previousRoute); 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, ), extendBody: true, bottomNavigationBar: RBottomNavigation( items: [ RBottomNavigationItem( icon: Assets.vec.filterSvg.path, label: 'درخواست‌ها', isSelected: currentIndex.value == 0, onTap: () => controller.changePage(0), ), RBottomNavigationItem( icon: Assets.vec.mapSvg.path, label: 'نقشه', isSelected: currentIndex.value == 1, onTap: () => controller.changePage(1), ), RBottomNavigationItem( icon: Assets.vec.profileUserSvg.path, label: 'پروفایل', isSelected: currentIndex.value == 2, onTap: () => controller.changePage(2), ), ], ), ), ); }, controller.currentIndex); } }