CustomElevatedButton class
A customizable elevated button with optional delay before triggering tap callbacks.
The CustomElevatedButton accepts an optional delay which is the duration the button waits before executing its onClick or onLongClick callbacks. During this delay, additional taps are ignored to prevent multiple triggers.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CustomElevatedButton
Constructors
- CustomElevatedButton({Key? key, String? label, Widget? child, void onClick()?, void onLongClick()?, void onHover(bool)?, void onFocusChange(bool)?, Color? backgroundColor, double? elevation, double? borderRadius, double? textSize, double? pixelHeight, double? pixelWidth, double? screenHeight, double? screenWidth, Color? textColor, BorderSide? side, OutlinedBorder? shape, Color? overlayColor, EdgeInsets? contentPadding, bool enabled = true, Duration delay = Duration.zero, Size? minimumSize, Size? maximumSize, Size? fixedSize, bool autofocus = false, Clip? clipBehavior, FocusNode? focusNode, WidgetStatesController? statesController, ButtonStyle? buttonStyle})
-
const
Properties
- autofocus → bool
-
final
- backgroundColor → Color?
-
Background color for the button.
final
- borderRadius → double?
-
Border radius for rounded corners.
final
-
final
- child → Widget?
-
A custom widget to display inside the button.
final
- clipBehavior → Clip?
-
final
- contentPadding → EdgeInsets?
-
Padding inside the button.
final
- delay → Duration
-
Delay before triggering the callback.
If set (e.g. Duration(milliseconds: 250)), the button waits for that duration
before executing the callback. During the delay, further taps are ignored.
final
- elevation → double?
-
Elevation for the button's material.
final
- enabled → bool
-
Whether the button is enabled.
final
- fixedSize → Size?
-
final
- focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
Text to be displayed on the button.
This value is ignored if a child widget is provided.
final
- maximumSize → Size?
-
final
- minimumSize → Size?
-
final
- onClick → void Function()?
-
Callback executed when the button is tapped.
final
- onFocusChange → void Function(bool)?
-
final
- onHover → void Function(bool)?
-
final
- onLongClick → void Function()?
-
Callback executed when the button is long pressed.
final
- overlayColor → Color?
-
Color for the button's overlay (e.g. on press).
final
- pixelHeight → double?
-
Explicit pixel height of the button.
final
- pixelWidth → double?
-
Explicit pixel width of the button.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenHeight → double?
-
Height of the button as a percentage of screen height.
final
- screenWidth → double?
-
Width of the button as a percentage of screen width.
final
- shape → OutlinedBorder?
-
Custom shape for the button's outline.
final
- side → BorderSide?
-
Border properties for the button.
final
- statesController → WidgetStatesController?
-
final
- textColor → Color?
-
Color of the text displayed on the button.
final
- textSize → double?
-
Font size for the label.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CustomElevatedButton> -
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited