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