tryReadBool method

bool? tryReadBool(
  1. dynamic source,
  2. dynamic key
)

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

Implementation

bool? tryReadBool(source, key) {
  var value = readValue(source, key);
  return isBool(value) ? value as bool : null;
}