ActionButton class

A compact, styled button designed for use in dialog footers and inline prompt panels.

Unlike Button, which is a full-featured button with multiple variants and sizes, ActionButton is intentionally simple: a text label wrapped in a colored container that responds to hover, selection, and tap.

Uses DialogThemeData for colors when available, falling back to semantic theme colors.

ActionButton(
  label: 'Allow once',
  isSelected: _selectedIndex == 0,
  onTap: () => _handleAllow(),
)
Inheritance

Constructors

ActionButton({required String label, bool isSelected = false, bool isDisabled = false, CmdCallback? onTap, Color? background, Color? selectedBackground, Color? foreground, Color? selectedForeground, EdgeInsets? padding, Key? key})

Properties

background Color?
Background color override (default state).
final
children List<Widget>
Child widgets that receive forwarded messages.
no setterinherited
debugRenderObjectPassthrough bool
Whether this widget is intentionally transparent to render-object layouts.
no setterinherited
focusable bool
Whether this widget can receive keyboard focus.
no setterinherited
foreground Color?
Text color override (default state).
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for this widget.
no setterinherited
isDisabled bool
Whether the button is disabled and non-interactive.
final
isSelected bool
Whether this button is currently selected/active.
final
key Key?
Key for preserving widget identity.
finalinherited
label String
The button label text.
final
onTap CmdCallback?
Called when the button is tapped.
final
padding EdgeInsets?
Padding inside the button. Defaults to horizontal: 1, vertical: 0.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedBackground Color?
Background color override (selected state).
final
selectedForeground Color?
Text color override (selected state).
final
theme Theme
Access the current theme.
no setterinherited

Methods

buildCachedView<T>(T builder(), Object? cacheKey) → T
Returns a cached view if the cache key matches.
inherited
createState() State<StatefulWidget>
Creates the mutable State associated with this widget.
override
handleInit() Cmd?
Override this instead of init for widget-specific initialization.
inherited
handleIntercept(Msg msg) → (Widget, Cmd?)
Override this to handle messages before they reach children.
inherited
handleUpdate(Msg msg) → (Widget, Cmd?)
Override this to handle messages specific to this widget.
inherited
init() Cmd?
Called once when the widget is first mounted.
inherited
invalidateCachedView() → void
Clears any cached view for this widget.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(Msg msg) → (Model, Cmd?)
Handles messages by forwarding to children then calling handleUpdate.
inherited
view() Object
Renders the widget to a string or View.
inherited

Operators

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