UDocMarkup class

One highlight / underline / note… anchored to a PDF page or an EPUB block.

PDF markups keep rects normalised to 0..1 of the page, so they are drawn exactly where they were made even if text extraction changes later. EPUB markups are anchored by pageIndex (spine item), blockIndex and the start/end offsets inside that block's text, which survive re-flow.

Annotations

Constructors

UDocMarkup({required String id, required UDocMarkupKind kind, required int pageIndex, required Color color, required DateTime createdAt, required DateTime updatedAt, 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?>{}})
const
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?>{}})
factory
UDocMarkup.fromJson(Map<String, Object?> json)
factory

Properties

blockIndex → int
final
bounds → Rect?
no setter
color → Color
final
createdAt → DateTime
final
end → int
final
extra → Map<String, Object?>
final
groupId → String
Markups made by one selection spanning several blocks share a group.
final
groupKey → String
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasNote → bool
no setter
id → String
final
isPlaced → bool
no setter
kind → UDocMarkupKind
final
note → String
final
pageIndex → int
final
rects → List<Rect>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
start → int
final
text → String
final
updatedAt → DateTime
final

Methods

copyWith({UDocMarkupKind? kind, Color? color, String? note, List<Rect>? rects, int? start, int? end, String? text, Map<String, Object?>? extra, bool touch = true}) → UDocMarkup
hitTest(Offset normalizedPoint, {double slop = 0.004}) → bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rectsIn(Size size) → List<Rect>
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited