Get map value by key as boolean.
bool? getBoolean(String key) { if (!this.containsKey(key)) { return null; } if (this[key] is! bool) { return null; } return this[key]; }