asBool function

bool asBool(
  1. Map<String, dynamic>? json,
  2. String key, {
  3. bool fallback = false,
})

Convert any map value with key to bool or fallback safely. If fallback is not provided, it defaults to false.

Implementation

bool asBool(Map<String, dynamic>? json, String key, {bool fallback = false}) {
  return toBool(
      asTOrNull(
        json,
        key,
      ),
      fallback: fallback);
}