import 'package:dio/dio.dart';
import 'package:get_it/get_it.dart';
import 'package:grocery_app/src/core/network_services/dio_client.dart';
import 'package:grocery_app/src/logic/repo/auth_repo.dart';
import 'package:grocery_app/src/logic/repo/order_repo.dart';
import 'package:grocery_app/src/logic/repo/product_repo.dart';
import 'package:grocery_app/src/logic/services/auth_service_locator.dart';
import 'package:grocery_app/src/logic/services/home_locator.dart';
import 'package:grocery_app/src/logic/services/orderSirvice.dart';

GetIt getIt = GetIt.instance;

class ServiceLocator {
  static void setup() {
    // dio client
    getIt.registerSingleton(Dio());
    getIt.registerSingleton(DioClient(getIt<Dio>()));
    getIt.registerSingleton(AuthServices());
    getIt.registerSingleton(ProductService());
    getIt.registerSingleton(OrderService());
    //     getIt.registerSingleton(HomeService());

    // Repos
    getIt.registerSingleton(AuthRepo(getIt<AuthServices>()));
    getIt.registerSingleton(ProductRepo(getIt<ProductService>()));
    getIt.registerSingleton(OrderRepo(getIt<OrderService>()));
// getIt.registerSingleton(HomeRepo(getIt<HomeService>()));
  }
}
