basicTypeToNum function

num? basicTypeToNum(
  1. Object? value
)

num or int or parse string

Implementation

num? basicTypeToNum(Object? value) {
  /// But most likely to happen first
  if (value is num) {
    return value;
  } else if (value == null) {
    return null;
  } else if (value is bool) {
    return value ? 1 : 0;
  } else if (value is String) {
    return _parseNum(value);
  } else {
    return _parseNum(value.toString());
  }
}