requireNotNull<T> function
Throws IllegalArgumentException if argument
is null
.
If message
is supplied, it is used as the error message.
Returns the argument
if it is not null.
Implementation
T requireNotNull<T>(T argument, [String? message]) =>
argument ??
(throw IllegalArgumentException(
message ?? 'Argument requires to be non-null'));