instanceFromRegistry<T extends Object> function

T instanceFromRegistry<T extends Object>({
  1. Type? type,
})

Implementation

T instanceFromRegistry<T extends Object>({Type? type}) {
  type ??= T;
  try {
    return _getIt.get(type: type) as T;
  } catch (_) {
    throw Exception('Dependency not found in registry: $type');
  }
}