Button.secondary constructor

const Button.secondary({
  1. Key? key,
  2. WidgetStatesController? statesController,
  3. Widget? leading,
  4. Widget? trailing,
  5. required Widget child,
  6. VoidCallback? onPressed,
  7. FocusNode? focusNode,
  8. AlignmentGeometry? alignment,
  9. bool? enabled,
  10. AbstractButtonStyle style = ButtonVariance.secondary,
  11. bool disableTransition = false,
  12. ValueChanged<bool>? onFocus,
  13. ValueChanged<bool>? onHover,
  14. bool disableHoverEffect = false,
  15. bool? enableFeedback,
  16. GestureTapDownCallback? onTapDown,
  17. GestureTapUpCallback? onTapUp,
  18. GestureTapCancelCallback? onTapCancel,
  19. GestureTapDownCallback? onSecondaryTapDown,
  20. GestureTapUpCallback? onSecondaryTapUp,
  21. GestureTapCancelCallback? onSecondaryTapCancel,
  22. GestureTapDownCallback? onTertiaryTapDown,
  23. GestureTapUpCallback? onTertiaryTapUp,
  24. GestureTapCancelCallback? onTertiaryTapCancel,
  25. GestureLongPressStartCallback? onLongPressStart,
  26. GestureLongPressUpCallback? onLongPressUp,
  27. GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate,
  28. GestureLongPressEndCallback? onLongPressEnd,
  29. GestureLongPressUpCallback? onSecondaryLongPress,
  30. GestureLongPressUpCallback? onTertiaryLongPress,
  31. AlignmentGeometry? marginAlignment,
  32. 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,
});