-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathlocator.dart
23 lines (19 loc) · 827 Bytes
/
locator.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import 'package:flutter_starter/helpers/empty.view.dart';
import 'package:flutter_starter/providers/theme.provider.dart';
import 'package:get_it/get_it.dart';
import 'services/firebase/auth.service.dart';
import 'services/api/api.service.dart';
import 'services/local/local.service.dart';
import 'viewmodels/login.viewmodel.dart';
GetIt locator = GetIt.instance;
void setupLocator() {
// Here you register all your services
locator.registerLazySingleton(() => AuthService());
locator.registerLazySingleton(() => ApiService());
locator.registerLazySingleton(() => LocalService());
// Here you register all your viewmodels
locator.registerFactory(() => LoginViewModel());
locator.registerFactory(() => EmptyViewModel());
// Here you register your providers
locator.registerFactory(() => ThemeProvider());
}