toFlatListOfStrings function
Converts s
to a List<String>.
Converts any collection to a flat list of strings.
Implementation
List<String> toFlatListOfStrings(Object? s,
{Pattern? delimiter, bool trim = true, bool ignoreEmpty = true}) {
if (s == null) {
return <String>[];
} else if (s is String) {
return _toFlatListOfStringsFromString(
s, delimiter ?? _toListOfStringsDelimiter, trim, ignoreEmpty);
} else if (s is Iterable) {
return _toFlatListOfStringsFromIterable(
s, delimiter ?? _toListOfStringsDelimiter, trim, ignoreEmpty);
} else {
return _toFlatListOfStringsFromString(
'$s', delimiter ?? _toListOfStringsDelimiter, trim, ignoreEmpty);
}
}