register<T> method

T register<T>(
  1. T factory(), {
  2. String? tag,
  3. bool? permanent,
})

Register a dependency or controller

Implementation

T register<T>(T Function() factory, {String? tag, bool? permanent}) {
  ZenLogger.logDebug('Registering $T in test container');

  final instance = factory();

  // Register in the test scope
  _scope.put<T>(
    instance,
    tag: tag,
    isPermanent: permanent ?? false,
  );

  return instance;
}