LukeFlowCanvas<T, E> class

A customizable flow canvas widget for creating node-based diagrams.

LukeFlowCanvas supports draggable nodes, connectable sockets, and visualizes connections between nodes using Bezier curves.

Inheritance

Constructors

LukeFlowCanvas.new({Key? key, required LukeFlowCanvasController<T, E> controller, required Widget nodeBuilder(NodeModel<T, E> node), Widget socketBuilder(NodeModel<T, E> node, NodeSocketModel<E> socket)?, LukeEdgePainter edgeBuilder(Offset source, Offset target, EdgeConnectionsModel<E> edgeConnection, double dashOffset)?, double socketWidth = 20, double socketHeight = 20, double socketRadius = 100, double width = 2024 * 8, double height = 2024 * 8, BackgroundGridSettings? bacgrkoundGridSettings, BackgroundGridSettings? secondaryBacgrkoundGridSettings, dynamic onUpdate(List<NodeModel<T, E>> nodes, List<EdgeConnectionsModel<E>> connections)?, dynamic onMouseMove(Vector2 position)?, dynamic onConnectionError(EdgeConnectionsModel<E> connection)?, dynamic onEdgeDrop(NodeSocketModel<E> source, Vector2 dropPosition)?, dynamic onNodesDeleted(List<NodeModel<T, E>> deletedNode)?, dynamic onDoubleTap(Vector2 mousePosition)?, EdgeConnectionsModel<E>? onBeforeConnectionCreate(EdgeConnectionsModel<E> connection, NodeSocketModel<E> fromSocket, NodeSocketModel<E> toSocket)?})
const

Properties

bacgrkoundGridSettings BackgroundGridSettings?
Settings for the backgrouind grid
final
controller LukeFlowCanvasController<T, E>
The controller to interact with the canvas programmatically.
final
edgeBuilder LukeEdgePainter Function(Offset source, Offset target, EdgeConnectionsModel<E> edgeConnection, double dashOffset)?
final
hashCode int
The hash code for this object.
no setterinherited
height double
Height of the canvas.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
nodeBuilder Widget Function(NodeModel<T, E> node)
Builds a custom widget for each node.
final
onBeforeConnectionCreate EdgeConnectionsModel<E>? Function(EdgeConnectionsModel<E> connection, NodeSocketModel<E> fromSocket, NodeSocketModel<E> toSocket)?
Callback triggered before a connection is created. It allows modifying the connection or returning null to cancel it.
final
onConnectionError → dynamic Function(EdgeConnectionsModel<E> connection)?
Handles connection error
final
onDoubleTap → dynamic Function(Vector2 mousePosition)?
Triggered when user double taps the canvas
final
onEdgeDrop → dynamic Function(NodeSocketModel<E> source, Vector2 dropPosition)?
Occurs when an edge is droped on the canvas without a target
final
onMouseMove → dynamic Function(Vector2 position)?
final
onNodesDeleted → dynamic Function(List<NodeModel<T, E>> deletedNode)?
final
onUpdate → dynamic Function(List<NodeModel<T, E>> nodes, List<EdgeConnectionsModel<E>> connections)?
Callback triggered whenever nodes or connections are updated.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryBacgrkoundGridSettings BackgroundGridSettings?
Settings for the backgrouind grid
final
socketBuilder Widget Function(NodeModel<T, E> node, NodeSocketModel<E> socket)?
Optionally builds a custom widget for each socket of a node.
final
socketHeight double
The height of each socket widget.
final
socketRadius double
The radius of each socket (used for detecting interactions).
final
socketWidth double
The width of each socket widget.
final
width double
Width of the canvas.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<LukeFlowCanvas<T, E>>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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