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 Scaffold( body: ObxValue( (currentIndex) => IndexedStack(index: currentIndex.value, children: controller.pages), controller.currentIndex, ), bottomNavigationBar: RBottomNavigation( mainAxisAlignment: MainAxisAlignment.spaceEvenly, items: [ RBottomNavigationItem( 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: () { Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); controller.changePage(1); }, ), RBottomNavigationItem( label: 'پروفایل', icon: Assets.vec.profileCircleSvg.path, isSelected: currentIndex.value == 4, onTap: () { Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst); Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst); controller.changePage(4); }, ), ], ), ); }, controller.currentIndex); } }