decimal method

double? decimal(
  1. String key
)

Reads an attribute as a double.

Implementation

double? decimal(String key) {
  final value = attributes[key];
  if (value is num) return value.toDouble();
  return double.tryParse(value?.toString() ?? '');
}