InkDecoration class Null safety

A decoration on a part of a Material.

This object is rarely created directly. Instead of creating an ink decoration directly, consider using an Ink widget, which uses this class in combination with Padding and ConstrainedBox to draw a decoration on a Material.

See also:

  • Ink, the corresponding widget.
  • 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 is painted.


InkDecoration({required Decoration? decoration, required ImageConfiguration configuration, required MaterialInkController controller, required RenderBox referenceBox, VoidCallback? onRemoved})
Draws a decoration on a Material.


configuration ImageConfiguration
The configuration to pass to the BoxPainter obtained from the decoration, when painting.
read / write
controller MaterialInkController
The MaterialInkController associated with this InkFeature.
read-only, inherited
decoration Decoration?
What to paint on the Material.
read / write
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


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.
toString() String
A string representation of this object.


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