FloatingInspectorButton class

悬浮检查器按钮 / Floating inspector button

可拖动,松手后自动吸附到最近边缘并"收入"边缘(仅露出小部分)。 收入状态点击露出部分会自动平滑拉出到完整可见,再次点击才打开面板。 Draggable; auto-docks to nearest edge on release and "tucks into" the edge (only a small portion peeks out). Tapping the peek smoothly pulls it out to fully visible; tap again to open the panel.

支持两种使用模式:

  1. 回调模式(推荐):通过 onPanelToggle 回调,面板由外部管理
  2. 独立模式:不提供 onPanelToggle,内部自动管理面板 Supports two usage modes:
  3. Callback mode (recommended): via onPanelToggle callback, panel managed externally
  4. Standalone mode: no onPanelToggle, panel managed internally

在生产环境(release模式)下,此组件会返回空容器,不会打包检查器代码 / In production environment (release mode), this widget returns an empty container, inspector code won't be bundled

Inheritance

Constructors

FloatingInspectorButton({Key? key, bool enabled = true, VoidCallback? onPanelToggle})
const

Properties

enabled bool
是否启用检查器按钮 / Whether to enable inspector button 默认根据环境自动判断:debug模式启用,release模式禁用 / Auto-detect by environment by default: enabled in debug mode, disabled in release mode
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPanelToggle VoidCallback?
面板显示/隐藏回调(可选)/ Panel toggle callback (optional) 点击按钮时触发,由外部决定如何显示面板 / Triggered when button is clicked, external decides how to show panel 如果为 null,则内部自动管理面板 / If null, manages panel internally
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<FloatingInspectorButton>
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
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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