checkNotNull<T> function

  1. @Deprecated('Use ArgumentError.checkNotNull. Will be removed in 4.0.0')
T checkNotNull<T>(
  1. T reference, {
  2. dynamic message,
})

Throws an ArgumentError if the given reference is null. Otherwise, returns the reference parameter.

Users of Dart SDK 2.1 or later should prefer ArgumentError.checkNotNull.

Implementation

@Deprecated('Use ArgumentError.checkNotNull. Will be removed in 4.0.0')
T checkNotNull<T>(T reference, {message}) {
  if (reference == null) {
    throw ArgumentError(_resolveMessage(message, 'null pointer'));
  }
  return reference;
}