tryReadString method

String? tryReadString(
  1. dynamic source,
  2. dynamic key
)

Tries to read a string value from the source. If the value is not a string, it returns null.

Implementation

String? tryReadString(source, key) {
  var value = readValue(source, key);
  return isString(value) ? value as String : null;
}