StringOrNum.fromJson constructor
StringOrNum.fromJson(
- dynamic json
Implementation
factory StringOrNum.fromJson(dynamic json) {
if (json == null) throw Exception('Cannot parse null as StringOrNum');
if (json is String) return StringOrNum.fromString(json);
if (json is num) return StringOrNum.fromNum(json);
throw Exception('Invalid type for StringOrNum: ${json.runtimeType}');
}