optString method

String optString(
  1. String name, {
  2. String fallback = "",
})

Returns the value mapped by {@code name} if it exists, coercing it if necessary, or {@code fallback} if no such mapping exists.

Implementation

String optString(String name, {String fallback = ""}) {
  dynamic object = opt(name);
  return __toString(object) ?? fallback;
}