checkNotNull<T> function
- @Deprecated('Use ArgumentError.checkNotNull. Will be removed in 4.0.0')
- T reference, {
- 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;
}