feat : cashing map from internet
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_livestock/data/common/constant.dart';
|
||||
import 'package:rasadyar_livestock/data/common/dio_exception_handeler.dart';
|
||||
import 'package:rasadyar_livestock/data/data_source/remote/auth/auth_remote.dart';
|
||||
import 'package:rasadyar_livestock/data/data_source/remote/auth/auth_remote_imp.dart';
|
||||
@@ -25,11 +26,14 @@ Future<void> setupLiveStockDI() async {
|
||||
await tokenService.saveBaseUrl('https://api.dam.rasadyar.net/');
|
||||
}
|
||||
|
||||
await FMTCStore(mapStoreKey).manage.create();
|
||||
|
||||
|
||||
// First register AppInterceptor with lazy callbacks
|
||||
diLiveStock.registerLazySingleton<AppInterceptor>(
|
||||
() => AppInterceptor(
|
||||
refreshTokenCallback: () async {
|
||||
/* // Use lazy access to avoid circular dependency
|
||||
// Use lazy access to avoid circular dependency
|
||||
final authRepository = diLiveStock.get<AuthRepository>();
|
||||
final hasAuthenticated = await authRepository.hasAuthenticated();
|
||||
if (hasAuthenticated) {
|
||||
@@ -37,7 +41,7 @@ Future<void> setupLiveStockDI() async {
|
||||
authRequest: {'refresh': tokenService.refreshToken.value},
|
||||
);
|
||||
return newToken?.access;
|
||||
}*/
|
||||
}
|
||||
return null;
|
||||
},
|
||||
saveTokenCallback: (String newToken) async {
|
||||
|
||||
Reference in New Issue
Block a user