AnnotationController<T> class

Controller for managing annotations in the node flow

This controller provides methods for creating, selecting, moving, and managing annotations within the node flow editor. All operations automatically handle MobX reactivity and coordinate with the parent NodeFlowController.

Key behaviors:

  • Snap-to-grid: Annotations respect the parent controller's snap-to-grid settings
  • Unified selection: Works with the unified selection system across nodes/connections
  • Theme integration: Automatically uses NodeFlowTheme for consistent styling

Constructors

AnnotationController(NodeFlowController<T> _parentController)

Properties

annotationCursor MouseCursor
no setter
annotations Map<String, Annotation>
no setter
draggedAnnotationId String?
no setter
hasAnnotationSelection bool
no setter
hashCode int
The hash code for this object.
no setterinherited
highlightedGroupId String?
no setter
isMovingGroupNodes bool
no setter
isResizing bool
no setter
lastPointerPosition Offset?
no setter
resizingGroupId String?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedAnnotation Annotation?
Gets the single selected annotation, if exactly one is selected.
no setter
selectedAnnotationIds Set<String>
Get all currently selected annotation IDs
no setter
sortedAnnotations List<Annotation>
no setter

Methods

addAnnotation(Annotation annotation) → void
bringAnnotationForward(String annotationId) → void
bringAnnotationToFront(String annotationId) → void
clearAnnotationSelection() → void
Clear all annotation selections
clearDragHighlight() → void
Clear drag highlight when node drag ends
createGroupAnnotation({required String id, required String title, required Offset position, required Size size, Color color = Colors.blue}) GroupAnnotation
Creates a new group annotation with the specified position and size.
createGroupAnnotationAroundNodes({required String id, required String title, required Set<String> nodeIds, EdgeInsets padding = const EdgeInsets.all(20.0), Color color = Colors.blue}) GroupAnnotation
Creates a group annotation that surrounds the specified nodes.
createMarkerAnnotation({required String id, required Offset position, MarkerType markerType = MarkerType.info, double size = 24.0, Color color = Colors.red, String? tooltip}) MarkerAnnotation
createStickyAnnotation({required String id, required Offset position, required String text, double width = 200.0, double height = 100.0, Color color = Colors.yellow}) StickyAnnotation
deleteSelectedAnnotations() → void
dispose() → void
endGroupResize() → void
Ends a group resize operation.
findContainedNodes(GroupAnnotation group) Set<String>
Finds all nodes that are completely contained within a group's bounds.
findIntersectingGroup(String nodeId) GroupAnnotation?
Check if a node intersects with any group annotation Returns the first intersecting group, or null if none found
getAnnotation(String annotationId) Annotation?
handleCommandDragGroupOperation(String nodeId, bool isCommandPressed) → void
Handle Command+drag group operations (add nodes to groups)
hideAllAnnotations() → void
internalEndAnnotationDrag() → void
internalHitTestAnnotations(Offset point) Annotation?
internalSelectAnnotation(String annotationId, {bool toggle = false}) → void
internalUpdateAnnotationCursor(MouseCursor cursor) → void
isAnnotationSelected(String annotationId) bool
Check if a specific annotation is currently selected
isGroupHighlighted(String groupId) bool
Check if a group is currently highlighted
moveSelectedAnnotations(Offset delta) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAnnotation(String annotationId) → void
resetGroupMoveFlag() → void
selectAnnotation(String annotationId, {bool toggle = false}) → void
Select or deselect an annotation
sendAnnotationBackward(String annotationId) → void
sendAnnotationToBack(String annotationId) → void
setAnnotationVisibility(String annotationId, bool visible) → void
showAllAnnotations() → void
startGroupResize(String groupId, ResizeHandlePosition handlePosition) → void
Starts a group resize operation from the specified handle position.
toString() String
A string representation of this object.
inherited
updateAnnotation(String annotationId, Annotation updatedAnnotation) → void
updateDragHighlight(String nodeId, bool isCommandPressed) → void
Update visual feedback during node drag (only during Command+drag)
updateGroupResize(Offset delta) → void
Updates the group size during a resize operation.

Operators

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