asString function

String asString(
  1. dynamic json,
  2. String key
)

Returns a String for the value at key. Throws a FormatException if the value cannot be converted.

Implementation

String asString(dynamic json, String key) {
  final value = _getJsonValueOrNull(json, key);
  return toString(value);
}