chore : change package supervision to inspection
This commit is contained in:
25
features/inspection/lib/presentation/root/logic.dart
Normal file
25
features/inspection/lib/presentation/root/logic.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:inspection/presentation/action/view.dart';
|
||||
import 'package:inspection/presentation/filter/view.dart';
|
||||
import 'package:inspection/presentation/profile/view.dart';
|
||||
|
||||
class RootLogic extends GetxController {
|
||||
RxInt currentIndex = 0.obs;
|
||||
List<Widget> pages = [SupervisionFilterPage(), ActionPage(), ProfilePage()];
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
void changePage(int index) {
|
||||
currentIndex.value = index;
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
62
features/inspection/lib/presentation/root/view.dart
Normal file
62
features/inspection/lib/presentation/root/view.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
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 Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
ObxValue(
|
||||
(currentIndex) => IndexedStack(
|
||||
index: currentIndex.value,
|
||||
children: controller.pages,
|
||||
),
|
||||
controller.currentIndex,
|
||||
),
|
||||
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: ObxValue(
|
||||
(index) => BottomNavigation1(
|
||||
items: [
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecMapSvg,
|
||||
label: 'نقشه',
|
||||
isSelected: controller.currentIndex.value == 0,
|
||||
onTap: () {
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecSettingSvg,
|
||||
label: 'اقدام',
|
||||
isSelected: controller.currentIndex.value == 1,
|
||||
onTap: () {
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecProfileCircleSvg,
|
||||
label: 'پروفایل',
|
||||
isSelected: controller.currentIndex.value == 2,
|
||||
onTap: () {
|
||||
controller.changePage(2);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
controller.currentIndex,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user