Skip to main content
The Stac Text Button allows you to build a Flutter text button widget using JSON. To know more about the text button widget in Flutter, refer to the official documentation.

Properties

PropertyTypeDescription
onPressedStacActionThe callback that is called when the button is tapped.
onLongPressStacActionThe callback that is called when the button is long-pressed.
onHoverStacActionThe callback that is called when the button is hovered over.
onFocusChangeStacActionThe callback that is called when the button’s focus changes.
styleStacButtonStyleThe style to apply to the button.
autofocusboolWhether the button should be focused when the page is loaded. Defaults to false.
clipBehaviorStacClipDetermines how the content should be clipped. Defaults to Clip.none.
isSemanticButtonboolDetermine whether this subtree represents a button. Defaults to true.
childStacWidgetThe widget to display inside the button.

Example

StacTextButton(
  onPressed: StacNoneAction(),
  style: StacButtonStyle(
    backgroundColor: StacColors.amber,
    foregroundColor: StacColors.black,
  ),
  autofocus: false,
  clipBehavior: StacClip.none,
  child: StacText(data: 'Click Me!'),
)