fromJson method Null safety

DisplayMode fromJson(
  1. dynamic val
)

Implementation

static DisplayMode fromJson(dynamic val) {
  for (final v in _intValues) {
    if (v._jsonName == val) {
      return v;
    }
  }
  if ((val as String).startsWith('f')) {
    return float(int.parse(val.substring(1)));
  }
  throw ArgumentError('Bad DisplayMode:  $val');
}