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