UMediaNotesController class

Owns the time-stamped notes of one media item, with persistence, undo/redo and a transport-safe export/import for server sync.

Inheritance

Constructors

UMediaNotesController({String? storageKey, void onChanged(UMediaNotesController controller)?, String? initialData, Color? color, int maxUndo = 60})

Properties

canRedo → bool
True when redo is possible.
no setter
canUndo → bool
True when undo is possible.
no setter
color ↔ Color
Color for new notes.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isEmpty → bool
True when there are no notes.
no setter
length → int
Number of notes.
no setter
markers → List<UVideoMarker>
Seek-bar markers for every note and drawing.
no setter
maxUndo → int
How many steps undo remembers.
final
notes → List<UMediaNote>
Notes sorted by time.
no setter
onChanged → void Function(UMediaNotesController controller)?
Called with the new value when the user changes it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shapes → List<UDocShape>
Drawings over the video frame, each visible during its time range.
no setter
storageKey → String?
Key the notes are saved under.
no setter
updatedAt → DateTime
Last change time.
no setter

Methods

activeAt(Duration position, {Duration tolerance = const Duration(seconds: 3)}) → List<UMediaNote>
Notes whose moment (or range) is at position within tolerance.
add({required Duration position, String text = "", Color? color, Duration? end}) → UMediaNote
Adds a note at position. notes.add(position: controller.value.position, text: "Important")
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addShape(UDocShape shape) → UDocShape
Adds a drawing shape.
attachStorage(String key) → Future<void>
Loads and auto-saves notes under key.
byId(String id) → UMediaNote?
Finds a note.
clear() → void
Deletes every note.
clearShapes({Duration? at}) → void
Removes every drawing, or only those visible at at.
dispose() → void
Discards any resources used by the object.
override
export({bool base64 = true}) → String
All notes as a compact string (base64 by default).
import(String data, {bool merge = false, bool notify = true}) → bool
Accepts export output (base64 or JSON) and the legacy SinApp {"markers":[{"seconds":…, "text":…, "color":…}]} payload.
indexBefore(Duration position) → int
Index of the last note at or before position, -1 when none.
load() → Future<void>
Loads saved notes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
redo() → void
Redoes an undone change.
remove(String id) → void
Deletes a note.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeShape(String id) → void
Removes a drawing shape.
replace(UMediaNote note) → void
Replaces a note (same id).
save() → Future<void>
Saves notes now.
Notes whose text contains query.
shapesAt(Duration position) → List<UDocShape>
Drawings to show at position.
toJson() → Map<String, Object?>
All notes as JSON.
toMarkdown({String title = ""}) → String
Notes as Markdown (for sharing).
toSrt({Duration length = const Duration(seconds: 4)}) → String
Notes as an SRT subtitle file (handy to replay notes as captions).
toString() → String
A string representation of this object.
inherited
undo() → void
Undoes the last change.
updateShape(UDocShape shape) → void
Rapid edits of one shape (dragging, resizing) share one undo step.

Operators

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