getSingleton<T extends Object> method

FutureOr<T> getSingleton<T extends Object>({
  1. Entity<Object>? groupEntity,
  2. bool traverse = true,
})
inherited

Implementation

FutureOr<T> getSingleton<T extends Object>({
  Entity? groupEntity,
  bool traverse = true,
}) {
  final groupEntity1 = groupEntity ?? focusGroup;
  final value = getSingletonOrNull<T>(
    groupEntity: groupEntity1,
    traverse: traverse,
  );

  if (value == null) {
    throw DependencyNotFoundException(
      type: T,
      groupEntity: groupEntity1,
    );
  }
  return value;
}