ButtonPanel class

描述: 主次按钮组成的横向面板 主按钮和边框按钮组成的集合 展示规则:

  • 一个主按钮 和 多个次级按钮
  • 次按钮不多于两个时,优先显示主按钮,剩下的地方平分给次按钮
  • 次按钮两个以上时,所有按钮等分,显示更多
  • 按钮之间的间距是 8
Inheritance

Constructors

ButtonPanel({Key? key, required String mainButtonName, required VoidCallback mainButtonOnTap, bool isMainBtnEnable = true, List<String>? secondaryButtonNameList, void secondaryButtonOnTap(int)?, List<ButtonPanelConfig>? secondaryButtonList, double horizontalPadding = 20, PopupDirection popDirection = PopupDirection.bottom})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
horizontalPadding → double
控件的左右的padding 默认值为20
final
isMainBtnEnable → bool
主按enable状态 默认值为true
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainButtonName → String
主按钮的文案
final
mainButtonOnTap → VoidCallback
主按钮点击的回调
final
popDirection → PopupDirection
popUpWindow位于targetView的方向,默认在下面
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secondaryButtonList → List<ButtonPanelConfig>?
包含config状态的次按钮,默认状态的话直接传secondaryButtonNameList即可
final
secondaryButtonNameList → List<String>?
默认状态下,次按钮的文案集合。如果需要改变按钮的可用状态,请使用 secondaryButtonList 初始化。
final
secondaryButtonOnTap → void Function(int)?
次按钮的点击回调
final

Methods

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