toml_viewer library

A Flutter widget for displaying TOML as an interactive, searchable tree.

The entry point is TomlView; appearance is controlled by TomlViewerConfig, TomlViewerColors, and TomlViewerStyle.

Classes

TomlArrayNode
A node holding a TOML array.
TomlErrorLine
Renders an inline error annotation for a TOML parse error.
TomlExpandController
Centralized controller for expand/collapse state across the tree.
TomlFormat
Formatting helpers for raw TOML values.
TomlLeafNode
A node holding a primitive TOML value: string, number, bool, or date/time.
TomlNode
A single addressable node in a TOML document tree.
TomlParseError
Represents a single parse error at a specific location in TOML source.
TomlParser
Handles TOML parsing with error collection and isolate offloading.
TomlParseResult
The result of parsing TOML content, supporting partial success.
TomlRow
Renders one row of the flattened TOML tree.
TomlSourceView
Renders raw TOML source with line numbers and error lines highlighted.
TomlTableNode
A node holding a TOML table (a key/value map).
TomlView
A widget that parses and displays TOML content as an interactive tree view.
TomlViewerColors
The colour palette used by the TOML viewer.
TomlViewerConfig
Configuration for the appearance, behaviour, and extensibility of the TOML viewer.
TomlViewerStyle
Complete text and layout styling for the TOML viewer.
TomlViewerTheme
Provides a TomlViewerConfig to descendant TomlViews without prop-drilling.
TomlVisibleRow
A node paired with the render-time state the row needs.

Enums

TomlCopyMode
What a long-press on a value does by default.
TomlViewMode
How TomlView presents its content.

Functions

flattenVisible(TomlTableNode root, {required bool isExpanded(String path), String? query, bool caseSensitive = false}) List<TomlVisibleRow>
Flattens a TOML tree into the linear list of rows that are currently visible, so the viewer can render them with a lazy ListView.

Typedefs

TomlKeyBuilder = Widget? Function(BuildContext context, String key, String path, bool isRoot)
Builds a custom widget for a TOML key label.
TomlRowBuilder = Widget? Function(BuildContext context, String key, Object? value, String path, bool? isExpanded, VoidCallback? onToggle)
Builds a custom widget for a complete key-value row.
TomlValueBuilder = Widget? Function(BuildContext context, Object? value, String path)
Builds a custom widget for a TOML value.
TomlValueCallback = void Function(BuildContext context, String key, Object? value, String path)
Called when a value is tapped, long-pressed, or copied.