tryGetString method
Retrieves a String value from the JSON map associated with the given key.
If the value associated with the key is already a String, it returns that value.
Otherwise, it returns defaultValue.
Unlike getString, this method does not store the parsed or existing String back into the JSON map.
Returns:
Implementation
@preferInline
String? tryGetString(
String key, {
String? defaultValue,
}) {
final value = _json[key];
if (value is String) {
return value;
}
return defaultValue;
}