InputButtonWidget class
A versatile button widget with optional icon, theming, loading state, and built-in tap debounce to prevent double-taps.
Supports two visual variants:
- Filled (default) — solid background with contrasting text.
- Border (
isBorderButton: true) — transparent background with a coloured border and matching text.
InputButtonWidget(
title: 'Submit',
onTap: _submit,
bgColor: AppColors.blueColor,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- InputButtonWidget
- Available extensions
Constructors
- InputButtonWidget({Key? key, required String title, VoidCallback? onTap, VoidCallback? onLongPress, BorderRadius? borderRadius, bool isBorderButton = false, String? asset, Duration debounceDuration = const Duration(milliseconds: 500), double? width, double? height, EdgeInsets? padding, double? fontSize, ColorModel? bgColor, double? assetSize, ColorModel? fontColor, bool isLoading = false, String? semanticLabel, String? semanticHint, bool? semanticsExcluded})
-
const
Properties
- asset → String?
-
Path to an SVG asset shown to the left of the label.
final
- assetSize → double?
-
final
- bgColor → ColorModel?
-
final
- borderRadius → BorderRadius?
-
final
- debounceDuration → Duration
-
Prevents accidental double-taps. The button is non-interactive for this
duration after each tap. Defaults to 500 ms.
final
- defaultHorizontalSpace → SizedBox
-
Available on Widget, provided by the WidgetExtension extension
no setter - defaultVerticalSpace → SizedBox
-
Available on Widget, provided by the WidgetExtension extension
no setter - fontColor → ColorModel?
-
final
- fontSize → double?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
final
- isBorderButton → bool
-
final
- isLoading → bool
-
When
true, shows a CircularProgressIndicator instead of the label.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onLongPress → VoidCallback?
-
final
- onTap → VoidCallback?
-
final
- padding → EdgeInsets?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticHint → String?
-
Optional accessibility hint announced after the label, describing
the action's effect (e.g. "Saves the form").
final
- semanticLabel → String?
-
Optional accessibility label announced by screen readers. Falls
back to title when null.
final
- semanticsExcluded → bool?
-
When
true, the button reportsenabled: falseto assistive technologies and is excluded from the focus tree. Defaults to detectingisLoadingand a nullonTapautomatically.final - title → String
-
final
- width → double?
-
final
Methods
-
center(
) → Center -
Available on Widget, provided by the WidgetExtension extension
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< InputButtonWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
lightGreyBackground(
{required BuildContext context}) → Container -
Available on Widget, provided by the WidgetExtension extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onTap(
GestureTapCallback callback, {VoidCallback? onLongPress}) → InkWell -
Available on Widget, provided by the WidgetExtension extension
-
padAll(
{double? value}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padBottom(
{double? bottom}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padHorizontal(
{double? horizontal}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padLeft(
{double? left}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padRight(
{double? right}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padTop(
{double? top}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padVertical(
{double? vertical}) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
padZero(
) → Padding -
Available on Widget, provided by the WidgetExtension extension
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
visible(
bool visible, {Widget? defaultWidget}) → Widget -
Available on Widget, provided by the WidgetExtension extension
set visibility
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited