DependenciesInit constructor

DependenciesInit({
  1. EnvironmentStore? environmentStore,
  2. required List<DependenciesProgress<Dependency>> progress,
})

Implementation

DependenciesInit({
  this.environmentStore,
  required List<DependenciesProgress> progress,
}) {
  for (final progress in progress) {
    final stopWatch = Stopwatch()..start();

    final dependency = progress(InitializationProgress(
      dependencies: dependencies,
      environmentStore: environmentStore ?? {},
    ));

    dependencies.addAll({
      dependency.runtimeType: dependency,
    });

    stopWatch.stop();

    debugPrint(
        '💡 ${dependency.runtimeType}: initialized successfully for ${stopWatch.elapsedMilliseconds} ms');
  }
}