feat : profile and map
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ModulesLogic extends GetxController {
|
||||
TokenStorageService tokenService = Get.find<TokenStorageService>();
|
||||
|
||||
List<ModuleModel> moduleList=[
|
||||
List<ModuleModel> moduleList = [
|
||||
ModuleModel(title: 'بازرسی', icon: Assets.icons.inspection.path, module: Module.inspection),
|
||||
ModuleModel(title: 'دام', icon: Assets.icons.liveStock.path, module: Module.liveStocks),
|
||||
ModuleModel(title: 'مرغ', icon: Assets.icons.liveStock.path, module: Module.chicken),
|
||||
];
|
||||
|
||||
|
||||
RxnInt selectedIndex = RxnInt(null);
|
||||
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void saveModule(Module module) {
|
||||
tokenService.saveModule(module);
|
||||
tokenService.appModule.value = module;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ class ModulesPage extends GetView<ModulesLogic> {
|
||||
icon: module.icon,
|
||||
onTap: () {
|
||||
controller.selectedIndex.value = index;
|
||||
controller.saveModule(module.module);
|
||||
|
||||
// Navigate to the appropriate route based on the selected module
|
||||
switch (module.module) {
|
||||
case Module.inspection:
|
||||
Get.toNamed(InspectionRoutes.init);
|
||||
|
||||
Reference in New Issue
Block a user