parseString function
Parses v
as String.
def
Default value if v
is invalid.
Implementation
String? parseString(Object? v, [String? def]) {
if (v == null) return def;
if (v is String) return v;
var s = v.toString().trim();
if (s.isEmpty) return def;
return s;
}