doubleOf<D> static method

D doubleOf<D>(
  1. dynamic json
)

Implementation

static D doubleOf<D>(json) {
  if (json == null) return null as D;
  if (json is double) {
    return json as D;
  } else if (json is num) {
    return json.toDouble() as D;
  } else {
    return null as D;
  }
}