getSyncOrNullT method

Object? getSyncOrNullT(
  1. Type type, {
  2. Entity<Object>? groupEntity,
  3. bool traverse = true,
  4. bool throwIfAsync = false,
})
inherited

Implementation

Object? getSyncOrNullT(
  Type type, {
  Entity? groupEntity,
  bool traverse = true,
  bool throwIfAsync = false,
}) {
  final value = getOrNullT(
    type,
    groupEntity: groupEntity,
    traverse: traverse,
  );
  if (throwIfAsync && value is Future) {
    throw DependencyIsFutureException(
      type: type,
      groupEntity: groupEntity,
    );
  }
  return value?.asSyncOrNull;
}