feat : new injection logic
test : some file :) chore : upgrade android gradle
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_app/presentation/routes/app_pages.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/inspection.dart';
|
||||
import 'package:rasadyar_livestock/injection/live_stock_di.dart';
|
||||
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||
|
||||
class ModulesLogic extends GetxController {
|
||||
TokenStorageService tokenService = Get.find<TokenStorageService>();
|
||||
@@ -32,21 +29,20 @@ class ModulesLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> navigateToModule(Module module) async {
|
||||
if (module == Module.inspection) {
|
||||
Get.offAllNamed(InspectionRoutes.init);
|
||||
} else if (module == Module.liveStocks) {
|
||||
await setupLiveStockDI();
|
||||
Get.offAllNamed(LiveStockRoutes.init);
|
||||
} else if (module == Module.chicken) {
|
||||
Get.offAllNamed(ChickenRoutes.init);
|
||||
var target = getTargetPage(module).entries.first;
|
||||
|
||||
if (target.value != null) {
|
||||
await target.value;
|
||||
}
|
||||
|
||||
Get.offAllNamed(target.key);
|
||||
}
|
||||
|
||||
void onTapCard(Module module, int index) async {
|
||||
isLoading.value = true;
|
||||
selectedIndex.value = index;
|
||||
saveModule(module);
|
||||
await Future.delayed(Duration(milliseconds: 800)); // Simulate loading delay
|
||||
await Future.delayed(Duration(milliseconds: 500)); // Simulate loading delay
|
||||
navigateToModule(module);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user