2021-02-02 14:33:23 +00:00
|
|
|
import 'package:get_it/get_it.dart';
|
|
|
|
|
|
|
|
import 'core/repositories/file_repository.dart';
|
2021-02-13 14:09:40 +00:00
|
|
|
import 'core/repositories/user_repository.dart';
|
2021-02-02 14:33:23 +00:00
|
|
|
import 'core/services/api.dart';
|
|
|
|
import 'core/services/dialog_service.dart';
|
|
|
|
import 'core/services/file_service.dart';
|
|
|
|
import 'core/services/link_service.dart';
|
|
|
|
import 'core/services/navigation_service.dart';
|
2021-02-03 00:57:42 +00:00
|
|
|
import 'core/services/permission_service.dart';
|
2021-02-04 00:07:03 +00:00
|
|
|
import 'core/services/refresh_service.dart';
|
2021-02-02 14:33:23 +00:00
|
|
|
import 'core/services/session_service.dart';
|
|
|
|
import 'core/services/storage_service.dart';
|
2021-02-13 14:09:40 +00:00
|
|
|
import 'core/services/user_service.dart';
|
2021-02-02 14:33:23 +00:00
|
|
|
import 'core/viewmodels/about_model.dart';
|
|
|
|
import 'core/viewmodels/history_model.dart';
|
|
|
|
import 'core/viewmodels/home_model.dart';
|
|
|
|
import 'core/viewmodels/login_model.dart';
|
|
|
|
import 'core/viewmodels/profile_model.dart';
|
|
|
|
import 'core/viewmodels/startup_model.dart';
|
|
|
|
import 'core/viewmodels/upload_model.dart';
|
|
|
|
|
|
|
|
GetIt locator = GetIt.instance;
|
|
|
|
|
|
|
|
void setupLocator() {
|
|
|
|
/// app helper services
|
|
|
|
locator.registerLazySingleton(() => NavigationService());
|
|
|
|
locator.registerLazySingleton(() => StorageService());
|
|
|
|
locator.registerLazySingleton(() => DialogService());
|
|
|
|
|
|
|
|
/// api + data repositories
|
|
|
|
locator.registerLazySingleton(() => Api());
|
|
|
|
|
|
|
|
locator.registerLazySingleton(() => FileRepository());
|
2021-02-13 14:09:40 +00:00
|
|
|
locator.registerLazySingleton(() => UserRepository());
|
2021-02-02 14:33:23 +00:00
|
|
|
|
|
|
|
/// services
|
|
|
|
locator.registerLazySingleton(() => SessionService());
|
2021-02-13 14:09:40 +00:00
|
|
|
locator.registerLazySingleton(() => UserService());
|
2021-02-02 14:33:23 +00:00
|
|
|
locator.registerLazySingleton(() => FileService());
|
|
|
|
locator.registerLazySingleton(() => LinkService());
|
2021-02-03 00:57:42 +00:00
|
|
|
locator.registerLazySingleton(() => PermissionService());
|
2021-02-04 00:07:03 +00:00
|
|
|
locator.registerLazySingleton(() => RefreshService());
|
2021-02-02 14:33:23 +00:00
|
|
|
|
|
|
|
/// view models
|
|
|
|
locator.registerFactory(() => StartUpViewModel());
|
|
|
|
locator.registerFactory(() => LoginModel());
|
|
|
|
locator.registerFactory(() => AboutModel());
|
|
|
|
locator.registerFactory(() => HomeModel());
|
|
|
|
locator.registerFactory(() => UploadModel());
|
|
|
|
locator.registerFactory(() => HistoryModel());
|
|
|
|
locator.registerFactory(() => ProfileModel());
|
|
|
|
}
|