asString function

String asString(
  1. Map<String, dynamic>? json,
  2. String key, {
  3. String defaultValue = "",
})

Implementation

String asString(Map<String, dynamic>? json, String key,
    {String defaultValue = ""}) {
  if (json == null || !json.containsKey(key)) return defaultValue;
  return toString(json[key]);
}