CustomInk class
🖋👆 A delightfully bouncy and position-mirroring reaction to user input on a piece of Material.
A circular ink feature whose origin immediately moves from input touch point to an X- and Y-mirrored point opposite the touch point; and whose radius expands from 0% of the final radius to twice that of the radius. The splash origin bounce-animates to the target mirror point of its referenceBox as it grows in radius and fades-in.
This object is rarely created directly. Instead of creating a CustomInk, consider using an InkResponse or InkWell widget, which uses gestures (such as tap and long-press) to trigger ink splashes. This class is used when the Theme's ThemeData.splashFactory is CustomInk.splashFactory.
See also:
- InkRipple, which is a built-in ink splash feature that expands less aggressively than the custom ink.
- InkSplash, which is a built-in ink splash feature that expands less aggressively than the ripple.
- InkResponse, which uses gestures to trigger ink highlights and ink splashes in the parent Material.
- InkWell, which is a rectangular InkResponse (the most common type of ink response).
- 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
- CustomInk
Constructors
- CustomInk({@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, VoidCallback onRemoved})
-
Begin a ripple, centered at
position
relative toreferenceBox
. [...]
Properties
- 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
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 non-existent method or property is accessed. [...]
inherited
-
paintFeature(
Canvas canvas, Matrix4 transform) → void -
Override this method to paint the ink feature. [...]
override
-
paintInkCircle(
{Canvas canvas, Matrix4 transform, Paint paint, Offset center, 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. [...]
@protected, inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
Constants
- splashFactory → const InteractiveInkFeatureFactory
-
Used to specify this type of ink splash for an InkWell, InkResponse
or material Theme.
_CustomInkFactory()