selfprivacy.org.app/lib/config/get_it_config.dart

30 lines
1.1 KiB
Dart
Raw Normal View History

2021-01-14 21:48:05 +00:00
import 'package:get_it/get_it.dart';
2021-03-25 20:09:56 +00:00
import 'package:selfprivacy/logic/get_it/api_config.dart';
import 'package:selfprivacy/logic/get_it/api_connection_repository.dart';
import 'package:selfprivacy/logic/get_it/console_model.dart';
2021-02-15 18:58:29 +00:00
import 'package:selfprivacy/logic/get_it/navigation.dart';
import 'package:selfprivacy/logic/get_it/resources_model.dart';
2021-01-14 21:48:05 +00:00
2021-03-25 23:30:34 +00:00
export 'package:selfprivacy/logic/get_it/api_config.dart';
2024-01-31 10:57:12 +00:00
export 'package:selfprivacy/logic/get_it/api_connection_repository.dart';
export 'package:selfprivacy/logic/get_it/console_model.dart';
2021-02-15 18:58:29 +00:00
export 'package:selfprivacy/logic/get_it/navigation.dart';
2022-06-05 19:36:32 +00:00
final GetIt getIt = GetIt.instance;
2021-01-14 21:48:05 +00:00
2021-03-25 20:09:56 +00:00
Future<void> getItSetup() async {
2021-02-15 18:58:29 +00:00
getIt.registerSingleton<NavigationService>(NavigationService());
2021-01-19 12:05:40 +00:00
getIt.registerSingleton<ConsoleModel>(ConsoleModel());
getIt.registerSingleton<ResourcesModel>(ResourcesModel()..init());
getIt.registerSingleton<WizardDataModel>(WizardDataModel()..init());
2024-05-15 15:47:41 +00:00
final apiConfigModel = ApiConfigModel();
getIt.registerSingleton<ApiConfigModel>(apiConfigModel);
2021-03-25 20:09:56 +00:00
getIt.registerSingleton<ApiConnectionRepository>(
ApiConnectionRepository()..init(),
);
2021-03-25 20:09:56 +00:00
await getIt.allReady();
2021-01-14 21:48:05 +00:00
}