MaterialButtonData constructor
const
MaterialButtonData({
- bool isEnabled = true,
- VoidCallback? onPressed,
- VoidCallback? onLongPress,
- MouseCursor? mouseCursor,
- FocusNode? focusNode,
- bool autofocus = kDefaultAutofocus,
- Widget? child,
- Key? widgetKey,
- ValueChanged<
bool> ? onHover, - ValueChanged<
bool> ? onFocusChange, - ButtonStyle? style,
- Clip? clipBehavior,
- WidgetStatesController? statesController,
- bool? isSemanticButton,
- Widget? icon,
- Widget? label,
- IconAlignment? iconAlignment,
child and (icon, label) are mutually exclusive. They are used to indicate the calling for the different variant of the button.
child is used for the normal button-constructors (useNormalConstructor).
(icon, label) are used for the .icon-constructors (useNormalConstructor).
When useNormalConstructor is true, iconAlignment will be ignored.
When useIconConstructor is true, mouseCursor will be ignored.
isSemanticButton seems to be only available for TextButton.
Implementation
const MaterialButtonData({
super.isEnabled,
super.onPressed,
super.onLongPress,
super.mouseCursor,
super.focusNode,
super.autofocus,
super.child,
super.widgetKey,
this.onHover,
this.onFocusChange,
this.style,
this.clipBehavior,
this.statesController,
this.isSemanticButton,
this.icon,
this.label,
this.iconAlignment,
});