SchematicCanvas class
Widget that wraps the schematic painter with interaction.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SchematicCanvas
Constructors
-
SchematicCanvas({required SchematicLayoutResult layout, Key? key, String? netlistJson, HierarchyService? externalHierarchy, SchematicColorScheme colorScheme = SchematicColorScheme.dark, Future<
SchematicLayoutResult?> onNodeToggle(String nodeId)?, Future<SchematicLayoutResult?> onPortExpand(String nodeId, String portId)?, Future<SchematicLayoutResult?> onPortExpandThrough(String nodeId, String portId)?, Future<SchematicLayoutResult?> onPortCollapse(String nodeId, String portId)?, Future<SchematicLayoutResult?> onPortCollapseThrough(String nodeId, String portId)?, Future<SchematicLayoutResult?> onCollapsePartial(String nodeId)?, Future<SchematicLayoutResult?> onExpandNonPrimitives(String nodeId)?, Future<SchematicLayoutResult?> onConvertToBlocksOnly(String nodeId)?, Future<SchematicLayoutResult?> onNodeToggleRecursive(String nodeId)?, Future<SchematicLayoutResult?> onExpandNonPrimitivesRecursive(String nodeId)?, Future<SchematicLayoutResult?> onConvertToBlocksOnlyRecursive(String nodeId)?, Future<SchematicLayoutResult?> onExpandWire(String nodeId, String portId)?, Future<SchematicLayoutResult?> onExpandChild(String nodeId, String portId)?, Future<SchematicLayoutResult?> onExpandPath(List<String> pathSegments, {String? targetWireName})?, String? pendingToggleNodeId, String? recentlyToggledNodeId, bool isDimmed = false, ({bool computed, String signalId, String value})? signalValueLookup(String wireName)?, String? signalNameForPort(String nodeId, String portId)?, String? focusPortId, void onSendSignals(List<String> signalPaths)?, String? directDriverSignalPath(String nodeId, String portId)?, bool hasExternalSignalListeners = true, GoToSourceCallback? onGoToSource, AvailableSourceFormats? availableSourceFormats, ValueNotifier<List< ? incomingSignalPaths})String> ?> -
Creates a schematic canvas widget.
const
Properties
- availableSourceFormats → AvailableSourceFormats?
-
Called before showing the right-click context menu to discover which
source formats are navigable for the current module. Uses cached module
info — must be synchronous so showMenu works.
final
- colorScheme → SchematicColorScheme
-
Color scheme to use for rendering.
final
- directDriverSignalPath → String? Function(String nodeId, String portId)?
-
Resolves the directly connected port driver for a selected wire.
final
- externalHierarchy → HierarchyService?
-
External hierarchy service from parent application. When provided, used
for signal search instead of building from netlistJson. This enables
sharing hierarchy state across DevTools, Wave Viewer, etc.
final
- focusPortId → String?
-
Port ID to focus on after incremental expansion.
When set, the canvas pans so this port is centred at the current zoom
level (instead of fitting the whole toggled node).
final
- hasExternalSignalListeners → bool
-
Whether external widgets (e.g. waveform viewer, signal table) are
listening for signals sent via
onSendSignals.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
incomingSignalPaths
→ ValueNotifier<
List< ?String> ?> -
Notifier for incoming signal paths from other viewers (cross-probing).
final
- isDimmed → bool
-
Whether the canvas should be dimmed (during layout computation).
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- layout → SchematicLayoutResult
-
Schematic layout data to render.
final
- netlistJson → String?
-
Original netlist JSON for comprehensive wire search (optional)
final
-
onCollapsePartial
→ Future<
SchematicLayoutResult?> Function(String nodeId)? -
Callback when the collapse (−) icon is clicked on a partially expanded
node. Clears partial expansion and returns the updated layout.
final
-
onConvertToBlocksOnly
→ Future<
SchematicLayoutResult?> Function(String nodeId)? -
Callback when the "convert to blocks-only" button is clicked on a
fully expanded node. Collapses the node then re-expands only
non-primitive children without edges.
final
-
onConvertToBlocksOnlyRecursive
→ Future<
SchematicLayoutResult?> Function(String nodeId)? -
Recursive variant of
onConvertToBlocksOnly(Shift+click). Converts to blocks-only down the full hierarchy.final -
onExpandChild
→ Future<
SchematicLayoutResult?> Function(String nodeId, String portId)? -
Callback to partially expand a specific child of a node by name.
Used by the search/navigate routine to reveal only the path to
a target without fully expanding every level.
final
-
onExpandNonPrimitives
→ Future<
SchematicLayoutResult?> Function(String nodeId)? -
Callback when the "expand non-primitives" button is clicked.
Reveals all non-primitive (submodule) hidden children of a node
via partial expansion.
final
-
onExpandNonPrimitivesRecursive
→ Future<
SchematicLayoutResult?> Function(String nodeId)? -
Recursive variant of
onExpandNonPrimitives(Shift+click). Expands non-primitives down the full hierarchy.final -
onExpandPath
→ Future<
SchematicLayoutResult?> Function(List<String> pathSegments, {String? targetWireName})? -
Batch-expand an entire hierarchy path in a single layout cycle.
final
-
onExpandWire
→ Future<
SchematicLayoutResult?> Function(String nodeId, String portId)? -
Callback to partially expand a node to reveal a specific wire by name.
Finds the hyperedge matching
wireNameand reveals its connected children plus the wire itself.final - onGoToSource → GoToSourceCallback?
-
Callback to navigate to a signal's source for a chosen RohdSourceFormat.
final
-
onNodeToggle
→ Future<
SchematicLayoutResult?> Function(String nodeId)? -
Callback when a node with children is tapped to expand/collapse.
Returns a Future with the updated layout model.
final
-
onNodeToggleRecursive
→ Future<
SchematicLayoutResult?> Function(String nodeId)? -
Recursive variant of
onNodeToggle(Shift+click). Expands/collapses the node and all descendant submodules.final -
onPortCollapse
→ Future<
SchematicLayoutResult?> Function(String nodeId, String portId)? -
Callback to collapse a single port's wire and connected trivial gates.
Reverse of
onPortExpand: removes the traced children/edges from partial expansion.final -
onPortCollapseThrough
→ Future<
SchematicLayoutResult?> Function(String nodeId, String portId)? -
Callback for recursive port collapse (Shift+click on a boundary port
that already has a visible wire). Reverse of
onPortExpandThrough.final -
onPortExpand
→ Future<
SchematicLayoutResult?> Function(String nodeId, String portId)? -
Callback when an interior port marker is clicked for incremental
expansion. Receives the instance (node) ID and the port ID.
Returns a Future with the updated layout model (or null on failure).
final
-
onPortExpandThrough
→ Future<
SchematicLayoutResult?> Function(String nodeId, String portId)? -
Callback for pass-through port expansion (Shift+click).
final
-
onSendSignals
→ void Function(List<
String> signalPaths)? -
Callback when the user wants to send selected signals to other viewers.
Receives a list of fully-qualified signal paths
(e.g.
"top/adder0/sum", "top/adder0/carry").final - pendingToggleNodeId → String?
-
Node ID that is currently being toggled (for immediate +/- flip feedback).
final
- recentlyToggledNodeId → String?
-
Node ID that was just toggled (used to fit view to this node after layout
updates).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signalNameForPort → String? Function(String nodeId, String portId)?
-
Callback to look up the signal name connected to an exterior port.
final
- signalValueLookup → ({bool computed, String signalId, String value})? Function(String wireName)?
-
Optional callback to look up a signal's current value by wire name.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SchematicCanvas> -
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.
override
-
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