nullValue<T> method

T nullValue<T>(
  1. T input, {
  2. String? name,
})

Throws an ArgumentError if input is null. Returns input otherwise.

Implementation

T nullValue<T>(T input, {String? name}) {
  if (input == null) {
    throw ArgumentError.notNull(name);
  }

  return input;
}