mirrored_repositories/architecture-template/lib/product/state
import 'package:clean_architecture/product/cache/product_cache.dart';
import 'package:clean_architecture/product/service/manager/product_service_manager.dart';
import 'package:clean_architecture/product/state/view_model/product_view_model.dart';
import 'package:core/core.dart';
import 'package:get_it/get_it.dart';

/// Product container for dependency injection
final class ProductContainer {
  const ProductContainer._();
  static final _getIt = GetIt.I;

  /// Product core required items
  static void setup() {
    _getIt
      ..registerSingleton(ProductCache(cacheManager: HiveCacheManager()))
      ..registerSingleton<ProductNetworkManager>(ProductNetworkManager.base())
      ..registerLazySingleton<ProductViewModel>(
        ProductViewModel.new,
      );
  }

  /// read your dependency item for [ProductContainer]
  static T read<T extends Object>() => _getIt<T>();
}
