57 lines
1.9 KiB
Dart
57 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rasadyar_core/core.dart';
|
|
|
|
import 'logic.dart';
|
|
|
|
class RootPage extends GetView<RootLogic> {
|
|
const RootPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ObxValue((currentIndex) {
|
|
return PopScope(
|
|
canPop: false,
|
|
child: Scaffold(
|
|
backgroundColor: AppColor.bgLight,
|
|
body: IndexedStack(index: currentIndex.value, children: controller.pages),
|
|
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 == 2,
|
|
onTap: () {
|
|
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
|
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
|
|
|
controller.changePage(2);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}, controller.currentIndex);
|
|
}
|
|
}
|