feat : init statics
This commit is contained in:
56
packages/inspection/lib/presentation/pages/root/view.dart
Normal file
56
packages/inspection/lib/presentation/pages/root/view.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user