ensureNotEmptyString function
If s
isEmptyString will return def
or null
.
def
Default value to return if s
isEmptyString.
trim
Passed to isEmptyString.
Implementation
String? ensureNotEmptyString(String? s, {bool trim = false, String? def}) {
if (isEmptyString(s, trim: trim)) {
return def;
}
return s;
}