feat : auth live stock
This commit is contained in:
@@ -4,6 +4,8 @@ import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_inspection/injection/inspection_di.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 CustomNavigationObserver extends NavigatorObserver {
|
||||
bool _isWorkDone = false;
|
||||
@@ -16,7 +18,7 @@ class CustomNavigationObserver extends NavigatorObserver {
|
||||
void didPush(Route route, Route? previousRoute) async {
|
||||
super.didPush(route, previousRoute);
|
||||
final routeName = route.settings.name;
|
||||
if (!_isWorkDone &&( routeName == ChickenRoutes.init || routeName == ChickenRoutes.auth)) {
|
||||
if (!_isWorkDone && (routeName == ChickenRoutes.init || routeName == ChickenRoutes.auth)) {
|
||||
_isWorkDone = true;
|
||||
await setupChickenDI();
|
||||
} else if (!_isWorkDone &&
|
||||
@@ -24,6 +26,10 @@ class CustomNavigationObserver extends NavigatorObserver {
|
||||
_isWorkDone = true;
|
||||
|
||||
await setupInspectionDI();
|
||||
} else if (!_isWorkDone &&
|
||||
(routeName == LiveStockRoutes.init || routeName == LiveStockRoutes.auth)) {
|
||||
_isWorkDone = true;
|
||||
await setupLiveStockDI();
|
||||
}
|
||||
tLog('CustomNavigationObserver: didPush - $routeName');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user