AntFloatingBubble class

Ant Design 悬浮气泡。

自身渲染为撑满父容器的透明层(Stack/Overlay 内放置, 非 bubble 区域使用 IgnorePointer 穿透手势), 气泡按 initialPos 定位并支持 axis 轴向拖拽, 拖拽范围默认约束在父容器边界内(constraint)。

Inheritance

Constructors

AntFloatingBubble({Key? key, AntFloatingBubbleAxis axis = AntFloatingBubbleAxis.both, Offset initialPos = Offset.zero, bool constraint = true, bool autoSnapToEdge = false, List<AntFloatingBubbleMenuAction>? menu, VoidCallback? onClick, AntFloatingBubbleController? controller, Widget? child, Color? backgroundColor, double? size})
const

Properties

autoSnapToEdge → bool
拖拽松手后是否自动吸附到最近的水平边缘(默认 false)。
final
axis → AntFloatingBubbleAxis
可拖拽轴向。
final
backgroundColor → Color?
自定义背景色(默认主题主色)。
final
child → Widget?
自定义图标内容。
final
constraint → bool
是否约束在父容器边界内(默认 true)。
final
controller → AntFloatingBubbleController?
程序化控制器(R35):显示/隐藏/移动/边缘吸附/重置位置。
final
hashCode → int
The hash code for this object.
no setterinherited
initialPos → Offset
初始位置(设计逻辑像素,内部按缩放因子缩放)。
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
菜单项列表(非空时点击气泡展开/收起菜单)。
final
onClick → VoidCallback?
气泡点击回调(配置 menu 时在展开/收起切换之外仍会触发)。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → double?
气泡尺寸(逻辑像素,默认 48)。
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<AntFloatingBubble>
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