LogViewerPanel class

  • @Author: chuxiong
  • @Created at: 2026/10/27
  • @Email:
  • @Company: 嘉联支付
  • description 日志查看器全屏面板页 全屏日志面板页:工具栏(搜索 / 级别阈值 / 时间窗 / 导出)+ 虚拟化列表 + 实时刷新。

数据面职责划分:

  • 窗口 / 级别阈值过滤在装配层——工具栏变更后带参重拉 loadViewerLogs;
  • 关键词搜索在面板本地——仅对已装配条目做 message / tag contains 过滤,不触发重拉。

列表按装配结果(timestamp 升序)倒序展示——最新条目在最上。

实时刷新:liveUpdates 事件仅作「有新日志」信号(列表数据一律以装配层 重拉结果为准,避免流与存储双源不一致),丢弃式节流合帧——首个事件 启动 200ms 单发 Timer,窗口期内后续事件丢弃,到期重拉装配层。

面板只读 + 导出:不暴露 clearLogs 等删除 API(设计裁决:数据破坏面 不进查看器)。颜色一律取 LogViewerTheme。

Inheritance
Available extensions

Constructors

LogViewerPanel({Key? key, Stream<LogEntry>? liveUpdates, LogLevel? initialMinLevel})
构造全屏日志面板。
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
initialMinLevel → LogLevel?
初始级别阈值(null = 全部级别)。
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
liveUpdates → Stream<LogEntry>?
实时刷新流(null = 不做实时刷新;宿主通常传入 LogViewerController.stream)。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<LogViewerPanel>
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.
inherited
gesture({GestureTapCallback? onTap, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress}) → Widget

Available on Widget, provided by the WidgetExt extension

用 GestureDetector(无水波纹)包裹本组件,支持单击 / 双击 / 长按。
gestureWithInkWellCircle({GestureTapCallback? onTap, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress}) → Material

Available on Widget, provided by the WidgetExt extension

用带水波纹的 Material + InkWell 包裹本组件,常用于圆形可点击区域。
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
padding(EdgeInsetsGeometry padding) → Widget

Available on Widget, provided by the WidgetExt extension

用 Padding 包裹本组件,等价于 Padding(padding: padding, child: this)。
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