getBool method

bool getBool (
  1. String key,
  2. [bool defaultValue]
)

Retrieve a value from this map

Implementation

bool getBool(String key, [bool defaultValue]) {
  if (!containsKey(key)) {
    return defaultValue;
  }

  dynamic valueDyn = this[key];

  if (valueDyn is bool) {
    return valueDyn;
  }

  if (valueDyn is String) {
    return stringToBool(valueDyn, defaultValue);
  }

  return defaultValue;
}