getBoolean method

bool getBoolean(
  1. String key, {
  2. bool defaultValue = false,
})

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

@param key a String @param defaultValue Value to return if key does not exist @return a boolean value

Implementation

bool getBoolean(String key, {bool defaultValue = false}) {
  // unparcel();
  var o = _map[key];
  if (o == null) {
    return defaultValue;
  }
  try {
    return o as bool;
  } catch (e) {
    // typeWarning(key, o, "Boolean", defaultValue, e);
    return defaultValue;
  }
}