Button.secondary constructor
const
Button.secondary({
- Key? key,
- WidgetStatesController? statesController,
- Widget? leading,
- Widget? trailing,
- required Widget child,
- VoidCallback? onPressed,
- FocusNode? focusNode,
- AlignmentGeometry? alignment,
- bool? enabled,
- AbstractButtonStyle style = ButtonVariance.secondary,
- bool disableTransition = false,
- ValueChanged<
bool> ? onFocus, - ValueChanged<
bool> ? onHover, - bool disableHoverEffect = false,
- bool? enableFeedback,
- GestureTapDownCallback? onTapDown,
- GestureTapUpCallback? onTapUp,
- GestureTapCancelCallback? onTapCancel,
- GestureTapDownCallback? onSecondaryTapDown,
- GestureTapUpCallback? onSecondaryTapUp,
- GestureTapCancelCallback? onSecondaryTapCancel,
- GestureTapDownCallback? onTertiaryTapDown,
- GestureTapUpCallback? onTertiaryTapUp,
- GestureTapCancelCallback? onTertiaryTapCancel,
- GestureLongPressStartCallback? onLongPressStart,
- GestureLongPressUpCallback? onLongPressUp,
- GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate,
- GestureLongPressEndCallback? onLongPressEnd,
- GestureLongPressUpCallback? onSecondaryLongPress,
- GestureLongPressUpCallback? onTertiaryLongPress,
- AlignmentGeometry? marginAlignment,
- bool disableFocusOutline = false,
Creates a secondary button with muted styling for supporting actions.
Secondary buttons use a subtle background color with medium contrast text, making them suitable for actions that are important but not primary. They have less visual weight than primary buttons and can be used more frequently.
Example:
Button.secondary(
onPressed: () => cancelAction(),
child: Text('Cancel'),
);
Implementation
const Button.secondary({
super.key,
this.statesController,
this.leading,
this.trailing,
required this.child,
this.onPressed,
this.focusNode,
this.alignment,
this.enabled,
this.style = ButtonVariance.secondary,
this.disableTransition = false,
this.onFocus,
this.onHover,
this.disableHoverEffect = false,
this.enableFeedback,
this.onTapDown,
this.onTapUp,
this.onTapCancel,
this.onSecondaryTapDown,
this.onSecondaryTapUp,
this.onSecondaryTapCancel,
this.onTertiaryTapDown,
this.onTertiaryTapUp,
this.onTertiaryTapCancel,
this.onLongPressStart,
this.onLongPressUp,
this.onLongPressMoveUpdate,
this.onLongPressEnd,
this.onSecondaryLongPress,
this.onTertiaryLongPress,
this.marginAlignment,
this.disableFocusOutline = false,
});