toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
  'name': name,
  if (unit != null) 'unit': unit,
  if (description != null) 'description': description,
  if (sum != null) 'sum': sum!.toJson(),
  if (gauge != null) 'gauge': gauge!.toJson(),
};