asBool function

bool asBool(
  1. dynamic json,
  2. String key
)

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

Implementation

bool asBool(dynamic json, String key) {
  final value = _getJsonValueOrNull(json, key);
  return toBool(value);
}