requireNotNull<T> function
Throws an IllegalStateException with the result of calling lazyMessage if the value is null.
Otherwise returns the not null value.
Implementation
T requireNotNull<T>(T? value, {Any Function()? lazyMessage}) {
if (value == null) throw Exception('IllegalStateException');
return value;
}