extractQuantity function
Implementation
double? extractQuantity(String key, Map<String, dynamic> properties) {
final value = properties[key];
if (value == null) return null;
if (value is num) {
return value.toDouble();
} else if (value is String) {
return double.tryParse(value);
}
return null;
}