runable
This commit is contained in:
22
lib/core/di/service_locator.dart
Normal file
22
lib/core/di/service_locator.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import '../network/dio_client.dart';
|
||||
import '../network/network_info.dart';
|
||||
|
||||
final getIt = GetIt.instance;
|
||||
|
||||
/// Setup dependency injection
|
||||
Future<void> setupServiceLocator() async {
|
||||
// External dependencies
|
||||
getIt.registerLazySingleton(() => Connectivity());
|
||||
|
||||
// Core
|
||||
getIt.registerLazySingleton(() => DioClient());
|
||||
getIt.registerLazySingleton(() => NetworkInfo(getIt()));
|
||||
|
||||
// Data sources - to be added when features are implemented
|
||||
|
||||
// Repositories - to be added when features are implemented
|
||||
|
||||
// Use cases - to be added when features are implemented
|
||||
}
|
||||
Reference in New Issue
Block a user