BouncyBall class Null safety

🏓 BouncyBall

random splashFactory and color on every tap--bouncy balls!A delightfully bouncy and position-mirroring reaction to user input on a piece of Material.


BouncyBall.splashFactory - bounce: An InteractiveInkFeatureFactory that produces 🏓 BouncyBalls as the ink splashes.


BouncyBall.marbleFactory - bounce: An InteractiveInkFeatureFactory that produces 🔮 Glass BouncyBalls (marbles) as the ink splashes.

splashFactory2, splashFactory3, & splashFactory4

InteractiveInkFeatureFactorys that produce 🏓 BouncyBalls
as their ink splashes with varying bounce patterns.

BouncyBall.splashFactory2 - bounce: BouncyBall.splashFactory3 - bounce: BouncyBall.splashFactory4 - bounce:


An InteractiveInkFeatureFactory factory whose splashFactory
🪀 molds 🏓 BouncyBalls 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 🏓 BouncyBalls.

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


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 to referenceBox. [...]


color Color
The ink's color.
read / write, inherited
controller MaterialInkController
The MaterialInkController associated with this InkFeature. [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
onRemoved VoidCallback?
Called when the ink feature is no longer visible on the material.
final, inherited
referenceBox RenderBox
The render box whose visual position defines the frame of reference for this ink feature.
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


cancel() → void
Called when the user input that triggered this feature's appearance was canceled. [...]
confirm() → void
Called when the user input that triggered this feature's appearance was confirmed. [...]
dispose() → void
Free up the resources associated with this ink feature.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
paintFeature(Canvas canvas, Matrix4 transform) → void
Override this method to paint the ink feature. [...]
paintInkCircle({required Canvas canvas, required Matrix4 transform, required Paint paint, required Offset center, required double radius, TextDirection? textDirection, ShapeBorder? customBorder, BorderRadius borderRadius =, RectCallback? clipCallback}) → void
Draws an ink splash or ink ripple on the passed in Canvas. [...]
@protected, inherited
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]

Static Methods

mold({required Paint rubber}) InteractiveInkFeatureFactory
🪀 mold 🏓 BouncyBalls [...]


marbleFactory → const InteractiveInkFeatureFactory
🔮 marbleFactory | Glass 🏓 BouncyBalls [...]
splashFactory → const InteractiveInkFeatureFactory
Bounce: "Bouncy Ball" [...]
splashFactory2 → const InteractiveInkFeatureFactory
Bounce: "Custom Ink" (Classic) [...]
_BouncyBallFactory(bounce: _CUSTOM_INK)
splashFactory3 → const InteractiveInkFeatureFactory
Bounce: "Toward Finger" [...]
_BouncyBallFactory(bounce: _TOWARD_FINGER)
splashFactory4 → const InteractiveInkFeatureFactory
Bounce: "Toward Face" [...]
_BouncyBallFactory(bounce: _TOWARD_FACE)