Button.ghost constructor

const Button.ghost({
  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.ghost,
  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 ghost button with minimal styling for subtle actions.

Ghost buttons have no background by default and only show subtle hover effects. They're perfect for actions that need to be available but shouldn't draw attention away from more important content.

Example:

Button.ghost(
  onPressed: () => showHelp(),
  leading: Icon(Icons.help_outline),
  child: Text('Help'),
);

Implementation

const Button.ghost({
  super.key,
  this.statesController,
  this.leading,
  this.trailing,
  required this.child,
  this.onPressed,
  this.focusNode,
  this.alignment,
  this.enabled,
  this.style = ButtonVariance.ghost,
  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,
});