SantoActionBarButton class
操作栏按钮
基于 SantoButton 实现:在 SantoActionBar 中自动平分剩余宽度, 位于整组按钮首位时左侧带圆角与外边距,末位时右侧带圆角与外边距, 中间的按钮保持直角,与相邻按钮拼成一组。
@changed v1.1.0 改为基于 SantoButton 实现
示例:
SantoActionBar(children: [
SantoActionBarIcon(icon: SantoIcons.headset, text: '客服'),
SantoActionBarButton(text: '加入购物车', type: SantoActionBarButtonType.warning),
SantoActionBarButton(text: '立即购买', type: SantoActionBarButtonType.danger),
])
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SantoActionBarButton
Constructors
- SantoActionBarButton({Key? key, String? text, Widget? child, SantoActionBarButtonType type = SantoActionBarButtonType.normal, Color? color, Widget? icon, bool loading = false, bool disabled = false, VoidCallback? onTap, bool first = true, bool last = true})
-
const
Properties
- child → Widget?
-
自定义按钮内容,优先级高于 text
final
- color → Color?
-
自定义背景色,优先级高于 type,使用自定义色时文字为白色
final
- disabled → bool
-
是否禁用,禁用后使用 SantoButton 的禁用态且不响应点击
final
- first → bool
-
是否为整组按钮的首个,由 SantoActionBar 按所在位置计算
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget?
-
文案左侧的图标
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- last → bool
-
是否为整组按钮的末个,由 SantoActionBar 按所在位置计算
final
- loading → bool
-
是否加载中,展示进度指示且不响应点击
final
- onTap → VoidCallback?
-
点击回调
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String?
-
按钮文案,与 child 至少提供一个
final
- type → SantoActionBarButtonType
-
按钮类型,决定背景色与文字色,默认 SantoActionBarButtonType.normal
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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
-
withPosition(
{required bool first, required bool last}) → SantoActionBarButton - 按在操作栏中的位置重建按钮,由 SantoActionBar 内部调用
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited