SButton class
A customizable button widget that supports various interactions and visual effects.
Features:
- Splash effects
- Bounce animation
- Bubble labels
- Double tap support
- Long press support
- Custom shapes (circle or rectangle)
- Haptic feedback
- Loading state
- Error handling
- Custom hit test behavior
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SButton
- Available extensions
Constructors
- SButton({Key? key, required Widget child, Color? splashColor, AlignmentGeometry? alignment, bool ignoreChildWidgetOnTap = false, bool isCircleButton = false, bool shouldBounce = true, double bounceScale = 0.98, BubbleLabelContent? bubbleLabelContent, Color? selectedColor, void onDoubleTap(Offset onTapPosition)?, void onTap(Offset onTapPosition)?, double? splashOpacity, void onLongPressStart(LongPressStartDetails)?, void onLongPressEnd(LongPressEndDetails)?, Duration? delay, HitTestBehavior hitTestBehavior = HitTestBehavior.opaque, bool enableHapticFeedback = true, HapticFeedbackType hapticFeedbackType = HapticFeedbackType.lightImpact, bool isLoading = false, Widget? loadingWidget, dynamic onError(Object error)?, Widget errorBuilder(BuildContext context, Object error)?, bool isActive = true, BorderRadius? borderRadius, String? tooltipMessage, bool disableOpacityChange = false, double? opacityWhenDisabled = 0.3, void onTappedWhenDisabled(Offset)?})
-
const
Properties
- alignment → AlignmentGeometry?
-
final
- borderRadius → BorderRadius?
-
The border radius applied to the button.
This clips the child widget and is used for splash effects and selected overlay.
If isCircleButton is true, this is ignored.
final
- bounceScale → double
-
final
- bubbleLabelContent → BubbleLabelContent?
-
final
- child → Widget
-
final
- delay → Duration?
-
final
- disableOpacityChange → bool
-
If true, opacity won't change when disabled
final
- enableHapticFeedback → bool
-
final
- errorBuilder → Widget Function(BuildContext context, Object error)?
-
final
- hapticFeedbackType → HapticFeedbackType
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitTestBehavior → HitTestBehavior
-
final
- ignoreChildWidgetOnTap → bool
-
final
- isActive → bool
-
final
- isCircleButton → bool
-
final
- isLoading → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingWidget → Widget?
-
final
- onDoubleTap → void Function(Offset onTapPosition)?
-
final
- onError → dynamic Function(Object error)?
-
final
- onLongPressEnd → void Function(LongPressEndDetails)?
-
final
- onLongPressStart → void Function(LongPressStartDetails)?
-
final
- onTap → void Function(Offset onTapPosition)?
-
final
- onTappedWhenDisabled → void Function(Offset)?
-
Callback when disabled widget is tapped, receives tap position
final
- opacityWhenDisabled → double?
-
Custom opacity level when disabled (0.0 - 1.0)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedColor → Color?
-
The color overlay displayed when the button is in a selected state.
final
- shouldBounce → bool
-
final
- splashColor → Color?
-
final
- splashOpacity → double?
-
final
- tooltipMessage → String?
-
final
Methods
-
addMaterialWidget(
) → Material -
Available on Widget, provided by the GenericExtensions extension
-
addTooltipWidget(
String toolTip) → Tooltip -
Available on Widget, provided by the GenericExtensions extension
-
borderRadius(
[BorderRadiusGeometry? borderRadius]) → Widget -
Available on Widget, provided by the GenericExtensions extension
-
boxDecoration(
[BoxDecoration? boxDecoration]) → Widget -
Available on Widget, provided by the GenericExtensions extension
-
colorFilter(
[ColorFilter? colorFilter]) → Widget -
Available on Widget, provided by the GenericExtensions extension
set parent widget in center -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SButton> -
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