Annotation constructor

Annotation({
  1. Reference? authorReference,
  2. String? authorString,
  3. DateTime? time,
  4. String? text,
})

Constructs a new Annotation.

Implementation

Annotation({
  Reference? authorReference,
  String? authorString,
  DateTime? time,
  String? text,
}) : this.fromJson(
        JsonObject({
          if (authorReference != null)
            authorReferenceField.name: authorReference.json,
          if (authorString != null)
            authorStringField.name: JsonString(authorString),
          if (time != null) timeField.name: JsonString(time.toString()),
          if (text != null) textField.name: JsonString(text),
        }),
      );