feat : cashing map from internet

This commit is contained in:
2025-08-20 11:05:31 +03:30
parent b2f26cdffd
commit 80e3b01998
9 changed files with 126 additions and 6 deletions

View File

@@ -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 {