TouchBarButton constructor
TouchBarButton({
- String? label,
- String? accessibilityLabel,
- Color? backgroundColor,
- TouchBarImage? icon,
- ImagePosition? iconPosition,
- VoidCallback? onClick,
Creates a new TouchBarButton item with the given label
,
accessibilityLabel
, backgroundColor
, icon
, iconPosition
and onClick
.
iconPosition
is set to (the first condition to match will be applied):
- ImagePosition.noImage if
icon
is null; - ImagePosition.imageOnly if
label
is null; - ImagePosition.left if
iconPosition
is null; - otherwise the
iconPosition
value will be used.
Implementation
TouchBarButton({
String? label,
String? accessibilityLabel,
Color? backgroundColor,
TouchBarImage? icon,
ImagePosition? iconPosition,
VoidCallback? onClick,
}) : this._accessibilityLabel = accessibilityLabel,
this._backgroundColor = backgroundColor,
this._labeledIcon = LabeledImage(
image: icon,
label: label,
imagePosition: iconPosition,
),
super() {
this.onClick = onClick;
}