Try to get the value of the properties as bool
bool? getBool(String key) => properties?.containsKey(key) ?? false ? properties![key] as bool? : null;