toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
  'id': id,
  'stateId': stateId,
  'startedAt': startedAt.millisecondsSinceEpoch,
  'completedAt': completedAt.millisecondsSinceEpoch,
  'elapsedSeconds': elapsedSeconds,
  'completedFull': completedFull,
  'emotion': emotion,
  if (avgHss != null) 'avgHss': avgHss,
  if (peakHss != null) 'peakHss': peakHss,
  if (historicTimePercent != null) 'historicTimePercent': historicTimePercent,
  if (contextRuptures != null) 'contextRuptures': contextRuptures,
};