extractRevenue function

double? extractRevenue(
  1. String key,
  2. Map<String, dynamic> properties
)

Implementation

double? extractRevenue(String key, Map<String, dynamic> properties) {
  if (properties[key] == null) {
    return null;
  }

  if (properties[key] is double || properties[key] is int) {
    return properties[key];
  } else if (properties[key] is String) {
    return double.parse(properties[key]);
  } else {
    return null;
  }
}