toJson method

Map<String, Object?> toJson()

Note as JSON.

Implementation

Map<String, Object?> toJson() => <String, Object?>{
  "id": id,
  "ms": position.inMilliseconds,
  if (end != null) "endMs": end!.inMilliseconds,
  "text": text,
  "color": color.toARGB32(),
  "created": createdAt.toIso8601String(),
  "updated": updatedAt.toIso8601String(),
  if (extra.isNotEmpty) "extra": extra,
};