StacTextButton class

A Stac model representing Flutter's TextButton widget.

Represents a Material Design text button that responds to touches by filling with color.

StacTextButton(
  onPressed: {'action': 'navigate', 'route': '/next'},
  child: StacText(data: 'Press me'),
  style: StacButtonStyle(elevation: 4.0),
)
{
  "type": "textButton",
  "child": {"type": "text", "data": "Press me"},
  "onPressed": {"action": "navigate", "route": "/next"}
}
Inheritance
Annotations
  • @JsonSerializable.new()

Constructors

StacTextButton({StacAction? onPressed, StacAction? onLongPress, StacAction? onHover, StacAction? onFocusChange, StacButtonStyle? style, bool? autofocus, StacClip? clipBehavior, bool? isSemanticButton, StacWidget? child})
Creates a StacTextButton with the given properties.
const
StacTextButton.fromJson(Map<String, dynamic> json)
Creates a StacTextButton from JSON.
factory

Properties

autofocus → bool?
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
child → StacWidget?
The widget below this widget in the tree. Typically a Text widget.
final
clipBehavior → StacClip?
How to clip the button's content.
final
hashCode → int
The hash code for this object.
no setterinherited
isSemanticButton → bool?
Whether this button is a semantic button.
final
jsonData → Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
onFocusChange → StacAction?
Called when the focus changes.
final
onHover → StacAction?
Called when a pointer enters or exits the button response area.
final
onLongPress → StacAction?
Called when the button is long-pressed.
final
onPressed → StacAction?
Called when the button is tapped or otherwise activated. If null, the button will be disabled.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style → StacButtonStyle?
Customizes this button's appearance.
final
type → String
Widget type identifier.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this button to JSON.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited