getServiceFactorySyncOrNull<T extends Service<Object?>> method

T? getServiceFactorySyncOrNull<T extends Service<Object?>>({
  1. Object? params,
  2. Entity<Object>? groupEntity,
  3. bool traverse = true,
  4. bool throwIfAsync = false,
})
inherited

Implementation

T? getServiceFactorySyncOrNull<T extends Service>({
  Object? params,
  Entity? groupEntity,
  bool traverse = true,
  bool throwIfAsync = false,
}) {
  final value = getServiceFactoryOrNull<T>(
    params: params,
    groupEntity: groupEntity,
    traverse: traverse,
  );
  if (throwIfAsync && value is Future) {
    throw DependencyIsFutureException(
      type: T,
      groupEntity: groupEntity,
    );
  }
  return value?.asSyncOrNull;
}