KScaleGestureWrapper class
A wrapper widget that provides a scaling "squish" effect when pressed.
This is typically used to create Apple/iOS style bouncy buttons, where the button shrinks slightly when pressed down and bounces back when released.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- KScaleGestureWrapper
Constructors
- KScaleGestureWrapper({Key? key, (double, double) scaleBetween = (1.0, 0.9), void onTapDown(TapDownDetails details)?, void onTapUp(TapUpDetails details)?, VoidCallback? onTap, VoidCallback? onLongPress, Duration animationDuration = Durations.medium2, Duration? delayReverseDuration, double borderRadius = 0, Curve? curve, required Widget child})
-
const
Properties
- animationDuration → Duration
-
The duration of the scale animation. Defaults to Durations.medium2.
final
- borderRadius → double
-
The border radius used for the InkWell splash effect.
final
- child → Widget
-
The widget below this widget in the tree.
final
- curve → Curve?
-
The curve used for the scale animation.
final
- delayReverseDuration → Duration?
-
Optional delay before the widget scales back to its original size after release.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onLongPress → VoidCallback?
-
The callback triggered when a long press is recognized.
final
- onTap → VoidCallback?
-
The callback triggered when a tap is correctly resolved.
final
- onTapDown → void Function(TapDownDetails details)?
-
final
- onTapUp → void Function(TapUpDetails details)?
-
The callback triggered when the pointer stops contacting the screen.
You can use delayReverseDuration to delay the release animation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleBetween → (double, double)
-
The scale factors to animate between: (normal scale, pressed scale).
Defaults to
(1.0, 0.9), meaning it shrinks to 90% of its size when pressed.final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< KScaleGestureWrapper> -
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