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