asBool method

bool asBool(
  1. String path, {
  2. bool defaultValue = true,
})

returns the value at path as an bool. If the value isn't an bool then an exception will be thrown. If the key isn't a valid bool then defaultValue is returned Use validBool to determine if the key exists and is a valid bool.

Implementation

bool asBool(String path, {bool defaultValue = true}) =>
    validBool(path) ? valueMap[path] as bool : defaultValue;