FFloat class

FFloat 能够在屏幕的任意位置浮出一个组件。甚至可以基于 anchor 锚点组件来动态的确定漂浮组件的位置。 FFloat 同时提供了绝妙的配置选项。圆角、描边、背景、偏移、装饰三角。 FFloat 设置了 FFloatController 控制器,可以方便的随时对漂浮组件进行控制。

FFloat can float a component anywhere on the screen. You can even dynamically determine the position of the floating component based on the anchor anchor component. FFloat also provides wonderful configuration options. Fillet, stroke, background, offset, decorative triangle. FFloat The FFloatController controller is set, which can easily control the floating component at any time.

Inheritance

Constructors

FFloat(FloatBuilder builder, {Widget anchor, Offset location, EdgeInsets margin = EdgeInsets.zero, double triangleWidth = 12, double triangleHeight = 6, TriangleAlignment triangleAlignment = TriangleAlignment.center, Offset triangleOffset = Offset.zero, FFloatAlignment alignment = FFloatAlignment.topCenter, EdgeInsets padding, Color color = _FFloatContent.DefaultColor, Color strokeColor, double strokeWidth, FFloatCorner corner, FFloatCornerStyle cornerStyle = FFloatCornerStyle.round, Color backgroundColor = Colors.transparent, Gradient gradient, bool canTouchOutside = true, bool hideTriangle = false, Duration autoDismissDuration, FFloatController controller, Duration animDuration = const Duration(milliseconds: 100), double shadowBlur = 1.0, Color shadowColor, Offset shadowOffset})

Properties

alignment FFloatAlignment
FFloat 基于 anchor 锚点元素的相对位置。
final
anchor Widget
锚点组件
final
animDuration Duration
显示/隐藏动效时长。默认 Duration(milliseconds: 100)
final
autoDismissDuration Duration
自动消失时长。如果为 null,就不会自动消失。
final
backgroundColor Color
FFloat 浮出时,背景区域的颜色
final
builder FloatBuilder
通过 FloatBuilder 返回 FFloat 的内容组件。 如果只更新内容区域的话,通过 setter((){}) 进行
final
canTouchOutside bool
点击 FFloat 范围外区域是否隐藏。
final
color Color
FFloat 的颜色
final
controller FFloatController
通过 FFloatController 可以控制 FFloat 的显示/隐藏。详见 FFloatController
final
corner FFloatCorner
圆角。详见 FFloatCorner
final
cornerStyle FFloatCornerStyle
圆角样式。详见 FFloatCornerStyle
final
gradient Gradient
设置组件渐变色背景。会覆盖 backgroundColor 你可选择 LinearGradientRadialGradientSweepGradient 等..
read / write
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
hideTriangle bool
是否隐藏装饰三角
final
key Key
Controls how one widget replaces another widget in the tree.
finalinherited
location Offset
位置。通过 location 指定 FFloat 的位置后,基于锚点确定位置的所有配置将失效。
final
margin EdgeInsets
FFloat 基于相对确定锚定点的间距
final
padding EdgeInsets
FFloat 内部间距
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
shadowBlur double
设置组件高斯与阴影形状卷积的标准偏差。
read / write
shadowColor Color
设置组件阴影颜色
read / write
shadowOffset Offset
设置组件阴影偏移
read / write
strokeColor Color
描边颜色
final
strokeWidth double
描边宽度
final
triangleAlignment TriangleAlignment
三角的相对位置。详见 TriangleAlignment
final
triangleHeight double
三角的高
final
triangleOffset Offset
三角的位置偏移
final
triangleWidth double
三角的宽
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _FFloatState
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.
@protectedinherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
dismiss() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
show(BuildContext context) → void
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}) 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.
@nonVirtualinherited