Button.link constructor

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

Creates a link-styled button with underline decoration.

Link buttons appear as inline text links, typically underlined on hover, making them suitable for navigation or inline actions within text. They have minimal visual presence and work well for tertiary actions or embedded links.

Example:

Button.link(
  onPressed: () => openUrl(),
  child: Text('View Documentation'),
);

Implementation

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