isNullOrEmpty method

String? isNullOrEmpty({
  1. String? valueName,
})

isNullOrEmpty checks is the String is null or empty. Provides a basic error message that can be used. 'valueName is required' A return value of null indicates a valid value.

thows an ArgumentError if valueName is null

Implementation

String? isNullOrEmpty({String? valueName}) {
  if (valueName == null) {
    throw ArgumentError('value name is required', valueName);
  }
  return this == null || this!.isEmpty ? '$valueName is required' : null;
}