BouncyBall class
🏓 BouncyBall
A delightfully bouncy and position-mirroring reaction to user input on a piece of Material. |
---|
splashFactory
An InteractiveInkFeatureFactory that produces 🏓 BouncyBall s as the ink splashes. |
---|
marbleFactory
An InteractiveInkFeatureFactory that produces 🔮 Glass BouncyBall s (marbles) as the ink splashes. |
---|
splashFactory2, splashFactory3, & splashFactory4
InteractiveInkFeatureFactorys that produce 🏓 BouncyBall
s
as their ink splashes with varying bounce patterns.
BouncyBall.mold
An InteractiveInkFeatureFactory factory whose splashFactory
🪀 molds 🏓 BouncyBall
s from custom rubber
Paint.
A circular ink feature whose origin immediately moves from input touch point to an X- and Y-mirrored point opposite the touch point, growing to twice the size of its referenceBox.
This object is rarely created directly.
Instead of creating a 🏓 BouncyBall
, consider using an
InkResponse or InkWell widget, which uses gestures
(such as tap and long-press) to trigger ink splashes.
When the Theme's ThemeData.splashFactory
is BouncyBall.splashFactory, ink splashes will be 🏓 BouncyBall
s.
See also:
- InkRipple, which is a built-in ink splash feature that expands less aggressively than 🏓 BouncyBall.
- InkWell, which uses gestures to trigger ink highlights and ink splashes in the parent Material.
- Material, which is the widget on which the ink splash is painted.
- InkHighlight, which is an ink feature that emphasizes a part of a Material
- Inheritance
-
- Object
- InkFeature
- InteractiveInkFeature
- BouncyBall
Constructors
- BouncyBall({required MaterialInkController controller, required RenderBox referenceBox, required Offset position, required Color color, required TextDirection textDirection, bool containedInkWell = false, RectCallback? rectCallback, BorderRadius? borderRadius, ShapeBorder? customBorder, double? radius, required Paint rubber, Curve bounce = _BOUNCY_BALL, VoidCallback? onRemoved})
-
Begin a ripple, centered at
position
relative toreferenceBox
.
Properties
- color ↔ Color
-
The ink's color.
getter/setter pairinherited
- controller → MaterialInkController
-
The MaterialInkController associated with this InkFeature.
no setterinherited
- customBorder ↔ ShapeBorder?
-
The ink's optional custom border.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- onRemoved → VoidCallback?
-
Called when the ink feature is no longer visible on the material.
finalinherited
- referenceBox → RenderBox
-
The render box whose visual position defines the frame of reference for this ink feature.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
) → void -
Called when the user input that triggered this feature's appearance was canceled.
override
-
confirm(
) → void -
Called when the user input that triggered this feature's appearance was confirmed.
override
-
dispose(
) → void -
Free up the resources associated with this ink feature.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paintFeature(
Canvas canvas, Matrix4 transform) → void -
Override this method to paint the ink feature.
override
-
paintInkCircle(
{required Canvas canvas, required Matrix4 transform, required Paint paint, required Offset center, required double radius, TextDirection? textDirection, ShapeBorder? customBorder, BorderRadius borderRadius = BorderRadius.zero, RectCallback? clipCallback}) → void -
Draws an ink splash or ink ripple on the passed in Canvas.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
mold(
{required Paint rubber}) → InteractiveInkFeatureFactory - 🪀 mold 🏓 BouncyBalls
Constants
- marbleFactory → const InteractiveInkFeatureFactory
- 🔮 marbleFactory | Glass 🏓 BouncyBalls
- splashFactory → const InteractiveInkFeatureFactory
- Bounce: "Bouncy Ball"
- splashFactory2 → const InteractiveInkFeatureFactory
- Bounce: "Custom Ink" (Classic)
- splashFactory3 → const InteractiveInkFeatureFactory
- Bounce: "Toward Finger"
- splashFactory4 → const InteractiveInkFeatureFactory
- Bounce: "Toward Face"