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