parseStringFromInlineMap function
Parses s
as a inline Map<String,String>.
delimiterPairs
Delimiter for pairs.
delimiterKeyValue
Delimiter for keys and values.
def
Default map if s
is invalid.
Implementation
Map<String, String>? parseStringFromInlineMap(
Object? s, Pattern delimiterPairs, Pattern delimiterKeyValue,
[Map<String, String>? def]) {
if (s == null) return def;
if (s is Map) {
return s.map((k, v) => MapEntry(parseString(k, '')!, parseString(v, '')!));
}
return parseFromInlineMap(s.toString(), delimiterPairs, delimiterKeyValue,
(e) => parseString(e)!, (e) => parseString(e)!, def);
}