getBool method

bool getBool(
  1. String key, {
  2. bool defaultValue = defaultBool,
})

Reads a key value of bool type from Map.

If value is NULL or not bool type return default value defaultBool

Implementation

bool getBool(String key, {bool defaultValue = defaultBool}) {
  if (containsKey(key)) {
    if (this[key] is bool) {
      return this[key] ?? defaultValue;
    }
  }
  errorLogsNS("Map.getBool[$key] has incorrect data : ${this[key]}");
  return defaultValue;
}