summarizeMessage static method
Produces the canonical compact summary used by every diagnostics view.
Implementation
static String summarizeMessage(Msg msg) {
return switch (msg) {
KeyMsg(:final key) =>
'key: ${key.type.name}${key.runes.isNotEmpty ? ' runes=${key.runes}' : ''}',
MouseMsg(:final action, :final button, :final x, :final y) =>
'mouse: ${action.name} ${button.name} ($x,$y)',
WindowSizeMsg(:final width, :final height) => 'resize: ${width}x$height',
TickMsg() => 'tick',
FrameTickMsg() => 'frameTick',
QuitMsg() => 'quit',
FocusMsg(:final focused) => 'focus: $focused',
CustomMsg(:final value) => 'custom: $value',
HotReloadStatusMsg(:final status) => 'hotReload: ${status.name}',
CapturedOutputMsg(:final line, :final source) =>
'output(${source.name}): ${line.length > 60 ? '${line.substring(0, 60)}...' : line}',
RenderMetricsMsg() => 'renderMetrics',
RenderBudgetMsg() => 'renderBudget',
RepaintMsg() => 'repaint',
InterruptMsg() => 'interrupt',
PasteMsg() => 'paste',
BatchMsg() => 'batch',
_ => msg.runtimeType.toString(),
};
}