fix : di
This commit is contained in:
@@ -6,10 +6,6 @@ final di = GetIt.instance;
|
|||||||
|
|
||||||
Future<void> setupPreInjection() async {
|
Future<void> setupPreInjection() async {
|
||||||
await setupAllCoreProvider();
|
await setupAllCoreProvider();
|
||||||
di.registerSingleton<DioRemote>(
|
|
||||||
DioRemote(baseUrl: 'https://everestacademy.ir/'),
|
|
||||||
instanceName: 'baseRemote',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setupInjection() async {
|
Future<void> setupInjection() async {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:rasadyar_app/infrastructure/service/app_navigation_observer.dart
|
|||||||
import 'package:rasadyar_app/presentation/routes/app_pages.dart';
|
import 'package:rasadyar_app/presentation/routes/app_pages.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
import 'infrastructure/di/di.dart';
|
import 'infrastructure/di/di.dart';
|
||||||
|
import 'presentation/routes/auth_route_resolver_impl.dart';
|
||||||
|
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
@@ -11,8 +12,7 @@ Future<void> main() async {
|
|||||||
await setupPreInjection();
|
await setupPreInjection();
|
||||||
Get.put(TokenStorageService());
|
Get.put(TokenStorageService());
|
||||||
await Get.find<TokenStorageService>().init();
|
await Get.find<TokenStorageService>().init();
|
||||||
|
Get.put<AuthRouteResolver>(AppAuthRouteResolver());
|
||||||
|
|
||||||
Get.put(AuthMiddleware());
|
Get.put(AuthMiddleware());
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:rasadyar_app/presentation/pages/modules/logic.dart';
|
||||||
|
import 'package:rasadyar_app/presentation/pages/modules/view.dart';
|
||||||
import 'package:rasadyar_app/presentation/pages/splash/logic.dart';
|
import 'package:rasadyar_app/presentation/pages/splash/logic.dart';
|
||||||
import 'package:rasadyar_app/presentation/pages/splash/view.dart';
|
import 'package:rasadyar_app/presentation/pages/splash/view.dart';
|
||||||
import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart';
|
import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart';
|
||||||
@@ -16,6 +18,13 @@ sealed class AppPages {
|
|||||||
|
|
||||||
static List<GetPage> pages = [
|
static List<GetPage> pages = [
|
||||||
GetPage(name: AppPaths.systemDesignPage, page: () => SystemDesignPage()),
|
GetPage(name: AppPaths.systemDesignPage, page: () => SystemDesignPage()),
|
||||||
|
|
||||||
|
GetPage(
|
||||||
|
name: AppPaths.moduleList,
|
||||||
|
page: () => ModulesPage(),
|
||||||
|
binding: BindingsBuilder.put(() => ModulesLogic()),
|
||||||
|
),
|
||||||
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: AppPaths.splash,
|
name: AppPaths.splash,
|
||||||
page: () => SplashPage(),
|
page: () => SplashPage(),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import 'package:rasadyar_core/infrastructure/local/hive_local_storage.dart';
|
|||||||
final diCore = GetIt.instance;
|
final diCore = GetIt.instance;
|
||||||
|
|
||||||
Future<void> setupAllCoreProvider() async {
|
Future<void> setupAllCoreProvider() async {
|
||||||
diCore.registerSingleton(AuthMiddleware());
|
|
||||||
await _setUpLogger();
|
await _setUpLogger();
|
||||||
await _setupLocalStorage();
|
await _setupLocalStorage();
|
||||||
await _setupRemote();
|
await _setupRemote();
|
||||||
@@ -23,4 +23,4 @@ Future<void> _setupLocalStorage() async {
|
|||||||
|
|
||||||
Future<void> _setupRemote() async {
|
Future<void> _setupRemote() async {
|
||||||
// diCore.registerSingleton<HiveLocalStorage>(HiveLocalStorage());
|
// diCore.registerSingleton<HiveLocalStorage>(HiveLocalStorage());
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user