feat: integrate GService into various root logic classes and log user roles during initialization
This commit is contained in:
@@ -39,6 +39,11 @@ class ActiveHatchingLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getHatchingList([bool isLoadingMore = false]) async {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreList.value = true;
|
||||
} else {
|
||||
|
||||
@@ -13,6 +13,7 @@ enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
|
||||
class CityPoultryRootLogic extends GetxController {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
var gService = Get.find<GService>();
|
||||
|
||||
late CityPoultryRepository cityPoultryRepository;
|
||||
|
||||
@@ -44,6 +45,7 @@ class CityPoultryRootLogic extends GetxController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
cityPoultryRepository = diChicken.get<CityPoultryRepository>();
|
||||
fLog('gService: ${gService.getRole(Module.chicken)}');
|
||||
}
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
@@ -69,14 +71,12 @@ class CityPoultryRootLogic extends GetxController {
|
||||
|
||||
final currentRoute = Get.routing.current;
|
||||
|
||||
// بررسی کن که آیا route فعلی یکی از routeهای داخلی است
|
||||
final isInternalRoute =
|
||||
currentRoute == CityPoultryRoutes.activeHatchingCityPoultry ||
|
||||
currentRoute == CityPoultryRoutes.newInspectionCityPoultry ||
|
||||
currentRoute == CityPoultryRoutes.actionCityPoultry;
|
||||
|
||||
// فقط اگر میتوان pop کرد و در یکی از صفحههای داخلی هستیم، pop کن
|
||||
if ( isInternalRoute) {
|
||||
if (isInternalRoute) {
|
||||
Get.back(id: cityPoultryActionKey);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user