DebugOverlayModel class final
Draggable render-metrics overlay for debugging TUI performance.
Intended to be composed by parent models:
- feed it
RenderMetricsMsg+WindowSizeMsg - call compose to overlay it above your main view
- use toggle to show/hide (the caller decides which key)
- use cycleMode to switch between metrics / messages / output / all
Message Log
Supply DevToolsMessageEntry items via the messageEntries field (typically sourced from ArtisanalDevTools.messageLog):
debugOverlay.copyWith(
messageEntries: devtools.messageLog.reversed.take(10).toList(),
)
Captured Output
Supply OutputLogEntry items via the outputEntries field (typically sourced from a model's OutputLog):
debugOverlay.copyWith(
outputEntries: model.outputLog.entries.reversed.take(10).toList(),
)
Constructors
-
DebugOverlayModel({required bool enabled, required int terminalWidth, required int terminalHeight, required RenderMetrics? metrics, required Map<
String, String> customMetrics, required int? panelX, required int? panelY, required bool dragging, required int dragOffsetX, required int dragOffsetY, int panelWidth = 40, int marginRight = 2, int marginTop = 0, int marginBottom = 2, String title = 'Render Metrics', String rendererLabel = 'UV', DebugOverlayMode mode = DebugOverlayMode.metrics, List<DevToolsMessageEntry> messageEntries = const <DevToolsMessageEntry>[], List<OutputLogEntry> outputEntries = const <OutputLogEntry>[], int maxDisplayMessages = 8, int maxDisplayOutput = 8}) - DebugOverlayModel.initial({bool enabled = false, int terminalWidth = 0, int terminalHeight = 0, String title = 'Render Metrics', String rendererLabel = 'UV', int panelWidth = 40, int marginRight = 2, int marginTop = 0, int marginBottom = 2})
-
factory
Properties
-
customMetrics
→ Map<
String, String> -
final
- dragging → bool
-
final
- dragOffsetX → int
-
final
- dragOffsetY → int
-
final
- enabled → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- marginBottom → int
-
final
- marginRight → int
-
final
- marginTop → int
-
final
- maxDisplayMessages → int
-
Maximum message entries shown in the panel.
final
- maxDisplayOutput → int
-
Maximum output entries shown in the panel.
final
-
messageEntries
→ List<
DevToolsMessageEntry> -
Recent message log entries to display in the Messages section.
final
- metrics → RenderMetrics?
-
final
- mode → DebugOverlayMode
-
Which sections to display. Defaults to DebugOverlayMode.metrics.
final
-
outputEntries
→ List<
OutputLogEntry> -
Recent captured output entries to display in the Output section.
final
- panelHeight → int
-
Current panel height based on cached render data.
no setter
- panelWidth → int
-
final
- panelX → int?
-
Stored top-left position. When null, uses default placement.
final
- panelY → int?
-
final
- rendererLabel → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- terminalHeight → int
-
final
- terminalWidth → int
-
final
- title → String
-
final
Methods
-
compose(
String base) → String -
Overlays the debug panel above
baseusing direct string manipulation. -
copyWith(
{bool? enabled, int? terminalWidth, int? terminalHeight, RenderMetrics? metrics, Map< String, String> ? customMetrics, Object? panelX = _unset, Object? panelY = _unset, bool? dragging, int? dragOffsetX, int? dragOffsetY, int? panelWidth, int? marginRight, int? marginTop, int? marginBottom, String? title, String? rendererLabel, DebugOverlayMode? mode, List<DevToolsMessageEntry> ? messageEntries, List<OutputLogEntry> ? outputEntries, int? maxDisplayMessages, int? maxDisplayOutput}) → DebugOverlayModel -
cycleMode(
) → DebugOverlayModel - Cycles through DebugOverlayMode values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
panel(
{int? terminalWidthOverride}) → String - Renders just the debug panel (cached for performance).
-
setEnabled(
bool v) → DebugOverlayModel -
toggle(
) → DebugOverlayModel -
toString(
) → String -
A string representation of this object.
inherited
-
update(
Msg msg) → ({Cmd? cmd, bool consumed, DebugOverlayModel model}) - Updates overlay state and reports whether the message was consumed.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited