getString static method
Returns the value at key coerced to String, or defaultValue.
Strings pass through; everything else is rendered with toString().
Returns defaultValue when the path is missing or the value is null.
Implementation
static String? getString(Map map, String key, [String? defaultValue]) {
final v = get(map, key);
if (v == null) return defaultValue;
if (v is String) return v;
return v.toString();
}