Button.text constructor
const
Button.text({
- Key? key,
- WidgetStatesController? statesController,
- Widget? leading,
- Widget? trailing,
- double? leadingGap,
- double? trailingGap,
- required Widget child,
- VoidCallback? onPressed,
- FocusNode? focusNode,
- AlignmentGeometry? alignment,
- bool? enabled,
- AbstractButtonStyle style = ButtonVariance.text,
- 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 text-only button with no background or border.
Text buttons display only their text content without any background fill or border decoration. They're the most minimal button style, useful for actions that should be accessible but not visually prominent, such as "Skip" or "Not now".
Example:
Button.text(
onPressed: () => skipStep(),
child: Text('Skip'),
);
Implementation
const Button.text({
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.text,
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,
});