LukeFlowCanvas<T> 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
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LukeFlowCanvas
Constructors
-
LukeFlowCanvas.new({Key? key, required List<
NodeModel< nodes, required Widget nodeBuilder(NodeModel<T> >T> node), required LukeFlowCanvasController<T> controller, Widget socketBuilder(NodeModel<T> node, NodeSocketModel socket)?, double socketWidth = 20, double socketHeight = 20, double socketRadius = 100, List<EdgeConnectionsModel> initialConnections = const [], dynamic onUpdate(List<NodeModel< nodes, List<T> >EdgeConnectionsModel> connections)?, double width = 2024 * 5, double height = 2024 * 5, dynamic onMouseMove(Vector2 position)?, BackgroundGridSettings? bacgrkoundGridSettings, dynamic onConnectionError(EdgeConnectionsModel connection)?, dynamic onEdgeDrop(NodeSocketModel source, Vector2 dropPosition)?, dynamic onNodesDeleted(List<NodeModel> deletedNode)?, dynamic onDoubleTap(Vector2 mousePosition)?}) -
const
Properties
- bacgrkoundGridSettings → BackgroundGridSettings?
-
Settings for the backgrouind grid
final
-
controller
→ LukeFlowCanvasController<
T> -
The controller to interact with the canvas programmatically.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Height of the canvas.
final
-
initialConnections
→ List<
EdgeConnectionsModel> -
The list of initial edge connections between nodes.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
nodeBuilder
→ Widget Function(NodeModel<
T> node) -
Builds a custom widget for each node.
final
-
nodes
→ List<
NodeModel< T> > -
The list of initial nodes to be rendered on the canvas.
final
- onConnectionError → dynamic Function(EdgeConnectionsModel connection)?
-
Handles connection error
final
- onDoubleTap → dynamic Function(Vector2 mousePosition)?
-
Triggered when user double taps the canvas
final
- onEdgeDrop → dynamic Function(NodeSocketModel 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> deletedNode)? -
final
-
onUpdate
→ dynamic Function(List<
NodeModel< nodes, List<T> >EdgeConnectionsModel> connections)? -
Callback triggered whenever nodes or connections are updated.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
socketBuilder
→ Widget Function(NodeModel<
T> node, NodeSocketModel 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> > -
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