Map<String, dynamic> toJson() { final json = <String, dynamic>{}; if (value != null) { json[r'value'] = value; } if (unit != null) { json[r'unit'] = unit; } return json; }