import 'package:get_it/get_it.dart';
import 'package:logger/logger.dart';
import 'package:satu/core/services/api_service.dart';
import 'package:satu/core/services/data_service.dart';
import 'package:satu/core/services/db_service.dart';
import 'package:satu/core/services/dialog_service.dart';
import 'package:satu/core/services/dictionary_service.dart';
import 'package:satu/core/services/navigator_service.dart';

import 'logger.dart';

GetIt locator = GetIt.I;

class LocatorInjector {
  static Logger _log = getLogger('LocatorInjector');

  static Future<void> setupLocator() async {
    _log.d('Initializing Api Service');
    locator.registerLazySingleton<ApiService>(() => ApiService());
    _log.d('Initializing Navigator Service');
    locator.registerLazySingleton<NavigatorService>(() => NavigatorService());
    _log.d('Initializing Dialog Service');
    locator.registerLazySingleton<DialogService>(() => DialogService());
    _log.d('Initializing DbService Service');
    locator.registerLazySingleton<DbService>(() => DbService.instance);


    // depencies


    _log.d('Initializing DataService Service');
    locator.registerLazySingleton<DataService>(() => DataService());
    _log.d('Initializing DictionaryService Service');
    locator.registerLazySingleton<DictionaryService>(() => DictionaryService());
  }
}