schematic_viewer library

Schematic canvas and painter components.

Classes

AppBarOverlay
Wraps a body widget and an appBar widget, where the AppBar auto-hides by sliding up when autoHide is true.
BaseHierarchyAdapter
Base class providing shared implementation for hierarchy adapters.
BaseSchematicViewerState<T extends StatefulWidget>
Base state class for schematic viewer pages. Contains common logic for layout computation, node toggling, and rendering.
BitDefineFieldsAction
User picked "Define Bit Fields..." and entered a non-empty list of named BitFieldDefs.
BitExpandRangeAction
User picked "Expand Bits" and (implicitly or via dialog) chose the bit range [bitEnd:bitStart] to expand into single-bit synthesized waveforms.
BitExpansionAction
Result of a bit-expansion menu interaction after any follow-up dialog has resolved. Returned by resolveBitExpansionMenuValue.
BitExpansionMenuValues
Popup-menu values used by the bit-expansion items.
BitFieldDef
A named bit-field definition within a bitvector signal.
BitFieldUtils
Shared utilities for parsing and formatting bit-field definitions.
CrossProbeButton
A toolbar icon button for cross-probing signal selections between viewers.
CrossProbeService
Abstract interface for cross-probing signal selections between viewers.
DtdService
Manages the DTD connection and service registration for source navigation.
EmbeddedSchematicViewer
Embedded schematic viewer that loads from a bundled asset or provided JSON. No AppBar, no Scaffold - just the schematic canvas for embedding.
ExportPngButton
Small camera-icon button for triggering PNG export.
FlcData
FLC data parsed from a v5 trie-based FLC hierarchy JSON file.
FlcEntry
Trace entry for a single signal or instance — one or more stack frames ordered innermost → outermost, plus output-language source locations.
FlcFrame
A single source location frame from an FLC trace.
FrameCycler
Manages frame cycling state for multi-frame source navigation.
HierarchyOccurrence
An occurrence of a module definition in the unfolded hierarchy tree.
HierarchyQuery
Abstract base class for hierarchy search queries.
HierarchySearchController<R>
Pure Dart controller for hierarchy search list navigation.
HierarchySearchResult
Base class for hierarchy search results.
HierarchyService
A source-agnostic interface for navigating hardware hierarchy.
LocalCrossProbeChannel
Shared in-process broadcast channel.
LocalCrossProbeService
Per-viewer CrossProbeService backed by a shared LocalCrossProbeChannel.
MarkdownHelpButton
A help button that loads its content from a markdown asset file.
NetlistHierarchyAdapter
Adapter that exposes a netlist as a source-agnostic hierarchy.
NetlistSchematicAdapter
Adapter that builds ROHD schematic data directly from documented Yosys JSON concepts: modules, ports, cells, connections, and netnames.
NullCrossProbeService
A no-op CrossProbeService for standalone or offline contexts where cross-probing between viewers is not available.
NullExtensionClient
A no-op RohdExtensionClient used when no extension is reachable.
OccurrenceAddress
Efficient hierarchical address using indices instead of strings.
OccurrenceSearchResult
Result of an occurrence search with enriched metadata.
OccurrenceTrie<T extends Object>
A prefix-sharing map from OccurrenceAddress values to values of type T.
PrefixQuery
Prefix-substring query: segments are matched via startsWith (signals) or contains (occurrences) at successive hierarchy depths.
RegexQuery
Regex/glob query: each segment is a compiled regex, with ** support for crossing hierarchy boundaries.
RegexSegment
A compiled regex segment for RegexQuery.
RohdExtensionClient
Abstract client for the ROHD VS Code extension handshake.
RohdFormatInfo
Availability status for a single source format.
RohdModuleInfo
Information returned by the ROHD extension for a specific module.
SchematicAppBar
A shared AppBar for all schematic viewer page variants.
SchematicCanvas
Widget that wraps the schematic painter with interaction.
SchematicCanvasState
State for SchematicCanvas, made public so that the embedding viewer can read/write the current pan offset and zoom scale via a GlobalKey.
SchematicColorScheme
Color scheme for schematic visualization with light and dark theme support.
SchematicConstants
Schematic layout constants
SchematicDependencyStatus
Status of JavaScript dependencies.
SchematicEdgeData
Data for a schematic edge (wire/connection).
SchematicHelpButton
A help button for the schematic viewer.
SchematicIcon
A custom-painted icon showing three colored rectangles connected by orthogonal (right-angle) wires — a miniature schematic diagram.
SchematicInstanceData
Data for a schematic instance (visual representation of a module instance/cell).
SchematicLayoutEngine
Abstract interface for schematic layout computation.
SchematicLayoutResult
Result of the schematic layout computation.
SchematicPainter
CustomPainter that draws the schematic.
SchematicPoint
A point in 2D space.
SchematicPortData
Data for a schematic port (I/O connection point on an instance).
SchematicThemeCubit
Cubit to manage schematic viewer theme state.
SchematicZoomRegionPainter
Painter for drawing the zoom-to-region overlay rectangle during CONTROL-drag.
SignalOccurrence
Signals are the fundamental data carriers in hardware. A signal can be:
SignalSearchResult
Result of a signal search with enriched metadata.
SignalValueFormatPreference
A format preference for one signal occurrence address.
SignalValueFormatRegistry
Shared display-format preferences keyed by occurrence address.
SourceFrame
A single source location frame.
StandaloneSchematicViewerPage
Standalone page used for both desktop (Linux / macOS / Windows) and web-dev (standalone browser, not VS Code extension) environments.
TypeFieldNode
A node in the expanded type tree, used for structured display.

Enums

OccurrenceTraversalMode
Controls whether child traversal crosses non-leaf hierarchy boundaries.
RohdSourceFormat
Identifies a source/output format the ROHD extension can navigate to.
SchematicExpansionMode
Controls the initial expansion state of the schematic after loading.
SchematicThemeMode
Theme mode options.
SearchTarget
What kind of hierarchy elements a query should match.
SignalValueFormat
The available display formats for signal values.

Extensions

HierarchyOccurrenceTraversal on HierarchyOccurrence
Child traversal available directly on a live hierarchy occurrence handle.

Constants

defaultHierarchySearchLimit → const int
Default maximum number of results returned by hierarchy search methods.
hierarchyPathSeparator → const String
Canonical separator used in hierarchy paths returned by this package.

Functions

buildBitExpansionMenuItems({required int width, double fontSize = 13, double itemHeight = 32, bool includeDivider = false}) List<PopupMenuEntry<String>>
Build the standard pair of popup-menu items shown when right-clicking a single multi-bit signal:
buildGotoSourceMenuItems({required List<RohdSourceFormat> formats, int count = 1, double height = 32, TextStyle? textStyle, bool showIcons = true, SourceFormatIconBuilder iconBuilder = sourceFormatMenuIcon}) List<PopupMenuItem<String>>
Build Go to <format> Source popup-menu items for formats.
buildRohdPopupMenuItem<T>({required T value, required Widget icon, required String label, double height = 32, TextStyle? textStyle, bool enabled = true}) PopupMenuItem<T>
Standard popup-menu item using the same fixed icon gutter as source rows.
captureBoundaryToPng(BuildContext context, {required GlobalKey<State<StatefulWidget>> boundaryKey, String filePrefix = 'export', double pixelRatio = 2.0, Future<String?> saveFn(Uint8List pngBytes, String fileName)?, Future<Uint8List?> encodeFn(RenderRepaintBoundary boundary, double pixelRatio)?}) Future<bool>
Capture a RepaintBoundary identified by boundaryKey, encode to PNG, save/download, and show a toast.
decodeGoToSourceRequest(String json) → (List<SourceFrame>, int)
Decode a goToSource request from a JSON string.
encodeGoToSourceRequest(List<SourceFrame> frames, {int index = 0}) String
Encode a goToSource request as a JSON string for stdio transport.
expandLogicType(Map<String, dynamic>? logicType, {String? parentBinaryValue}) List<TypeFieldNode>
Expand a logic_type metadata map into a tree of TypeFieldNodes.
formatFieldValue(String? binaryValue, int width) String
Format a binary field value for display.
formatTypeTooltip(Map<String, dynamic>? logicType, {String? parentBinaryValue, String? signalName, int maxDepth = 6}) String
Build a multi-line indented string showing struct/array fields with values.
gotoSourceFormatFromValue(String? value) RohdSourceFormat?
Decode a popup-menu value produced by gotoSourceMenuValue.
gotoSourceMenuLabel(RohdSourceFormat format, {int count = 1}) String
Menu label for Go to <format> Source, pluralized with count.
gotoSourceMenuValue(RohdSourceFormat format) String
Encode a popup-menu value for navigating to format.
gotoSourceShortName(RohdSourceFormat format) String
Short, menu-friendly name for format (e.g. 'ROHD', 'SV').
hexToBinary(String hexValue, int width) String?
Convert a hex value string (e.g. "0x1a3f" or "1a3f") to binary (MSB-first).
normalizePath(String filePath) String
Normalize a file path by collapsing . and .. segments.
resolveBitExpansionMenuValue(BuildContext context, {required String? value, required String signalName, required int width}) Future<BitExpansionAction?>
Translate a popup-menu value returned by showMenu<String> into a BitExpansionAction, showing any follow-up dialog as needed.
resolveCandidatePaths(String filePath, {List<String> workspaceRoots = const [], int parentLevels = 4}) List<String>
Generate candidate paths for a package-relative file path.
resolveNavigableFormats(RohdModuleInfo? info) List<RohdSourceFormat>
Resolve which navigable source formats to display for info.
savePngBytes(Uint8List pngBytes, String fileName) Future<String?>
Stub — always throws.
showBitRangeDialog(BuildContext context, {required String signalName, required int width}) Future<(int, int)?>
Show a dialog to select a bit range for a signal.
showDefineBitFieldsDialog(BuildContext context, {required String signalName, required int width, List<BitFieldDef>? existingDefs}) Future<List<BitFieldDef>?>
Show a dialog to define named bit-field slices on a signal.
showExportToast(BuildContext context, String message, {Duration duration = const Duration(seconds: 3)}) → void
Show a brief floating toast at the bottom of the screen.
sourceFormatIcon(RohdSourceFormat format, {double size = 18}) Widget
Backwards-compatible alias for sourceFormatMenuIcon.
sourceFormatIconStrip({required Iterable<RohdSourceFormat> formats, SourceFormatIconBuilder iconBuilder = sourceFormatMenuIcon, double size = 16, double gap = 3}) Widget
Compact strip of source/output format icons for trace-picker menu rows.
sourceFormatMenuIcon(RohdSourceFormat format, {double size = 18}) Widget
App-bar-style icon for a source/output format.
sourcePopupMenuRow({required Widget icon, required String label, TextStyle? textStyle, double iconSlotWidth = 22, double gap = 8}) Widget
Standard popup-menu row with a fixed-width prefix icon and ellipsized label.

Typedefs

AvailableSourceFormats = List<RohdSourceFormat> Function()
Returns the source formats currently navigable for the active module.
GoToSourceCallback = void Function(RohdSourceFormat format, List<String> signalPaths)
Invoked when the user picks Go to <format> Source for signalPaths.
SourceFormatIconBuilder = Widget Function(RohdSourceFormat format, {double size})
Builds an icon for a source/output format.