getSingletonSync<T extends Object> method

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

Implementation

T getSingletonSync<T extends Object>({
  Entity? groupEntity,
  bool traverse = true,
}) {
  final value = getSingleton<T>(
    groupEntity: groupEntity,
    traverse: traverse,
  );
  if (value is Future) {
    throw DependencyIsFutureException(
      type: T,
      groupEntity: groupEntity,
    );
  } else {
    return value;
  }
}