notNull<T> function Null safety

T notNull<T>(
  1. T object,
  2. {LazyMessage message = _DEFAULT_IS_NULL_EX_MESSAGE}
)

Implementation

T notNull<T>(final T object,
    {final LazyMessage message = _DEFAULT_IS_NULL_EX_MESSAGE}) {
  if (object == null) {
    throw new ArgumentError(message());
  }
  return object;
}