Converts value to a num if possible, otherwise returns null.
value
num? numOrNull(dynamic value) { if (value == null) return null; if (value is num) return value; return num.tryParse(value.toString()); }