DoubleWithUnit.fromJSON constructor

DoubleWithUnit.fromJSON(
  1. Map<String, dynamic> json
)

Implementation

DoubleWithUnit.fromJSON(Map<String, dynamic> json)
    : this(
          (json.containsKey('value') ? json['value'] as num : throw ArgumentError('json does not containe value'))
              .toDouble(),
          MesaureUnitDeserializer.fromJSON(json['unit'] as String?));