import 'package:get_it/get_it.dart';
import 'package:http/http.dart' as http;

import '../../data/datasources/user_remote_data_source.dart';
import '../../data/repositories/user_repository_impl.dart';
import '../../domain/usecases/get_user.dart';

final sl = GetIt.instance;

void init() {
  // Register Http Client
  sl.registerLazySingleton(() => http.Client());

  // Register Data Sources
  sl.registerLazySingleton(() => UserRemoteDataSource(sl()));

  // Register Repositories
  sl.registerLazySingleton(() => UserRepositoryImpl(remoteDataSource: sl()));

  // Register Use Cases
  sl.registerLazySingleton(() => GetUser(sl()));
}
