UDocMarkup.create constructor

UDocMarkup.create({
  1. required UDocMarkupKind kind,
  2. required int pageIndex,
  3. required Color color,
  4. String groupId = "",
  5. int blockIndex = -1,
  6. int start = 0,
  7. int end = 0,
  8. String text = "",
  9. List<Rect> rects = const <Rect>[],
  10. String note = "",
  11. Map<String, Object?> extra = const <String, Object?>{},
})

Implementation

factory UDocMarkup.create({
  required UDocMarkupKind kind,
  required int pageIndex,
  required Color color,
  String groupId = "",
  int blockIndex = -1,
  int start = 0,
  int end = 0,
  String text = "",
  List<Rect> rects = const <Rect>[],
  String note = "",
  Map<String, Object?> extra = const <String, Object?>{},
}) {
  final DateTime now = DateTime.now();
  return UDocMarkup(
    id: _newId(),
    groupId: groupId,
    kind: kind,
    pageIndex: pageIndex,
    blockIndex: blockIndex,
    start: start,
    end: end,
    text: text,
    rects: rects,
    color: color,
    note: note,
    createdAt: now,
    updatedAt: now,
    extra: extra,
  );
}