A rectangular area of a Material that responds to touch.

For a variant of this widget that does not clip splashes, see InkResponse.

The following diagram shows how an InkWell looks when tapped, when using default values.

The highlight is a rectangle the size of the box.

The InkResponse widget must have a Material widget as an ancestor. The Material widget is where the ink reactions are actually painted. This matches the material design premise wherein the Material is what is actually reacting to touches by spreading ink.

If a Widget uses this class directly, it should include the following line at the top of its build function to call debugCheckHasMaterial:

assert(debugCheckHasMaterial(context));

See also:

Inheritance

Constructors

InkWell({Key key, Widget child, GestureTapCallback onTap, GestureTapCallback onDoubleTap, GestureLongPressCallback onLongPress, ValueChanged<bool> onHighlightChanged, Color highlightColor, Color splashColor, BorderRadius borderRadius })
Creates an ink well. [...]
const

Properties

borderRadius BorderRadius
The clipping radius of the containing rect.
final, inherited
child Widget
The widget below this widget in the tree.
final, inherited
containedInkWell bool
Whether this ink response should be clipped its bounds. [...]
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
highlightColor Color
The highlight color of the ink response. If this property is null then the highlight color of the theme will be used. [...]
final, inherited
highlightShape BoxShape
The shape (e.g., circle, rectangle) to use for the highlight drawn around this part of the material. [...]
final, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
onDoubleTap GestureTapCallback
Called when the user double taps this part of the material.
final, inherited
onHighlightChanged ValueChanged<bool>
Called when this part of the material either becomes highlighted or stops being highlighted. [...]
final, inherited
onLongPress GestureLongPressCallback
Called when the user long-presses on this part of the material.
final, inherited
onTap GestureTapCallback
Called when the user taps this part of the material.
final, inherited
radius double
The radius of the ink splash. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
splashColor Color
The splash color of the ink response. If this property is null then the splash color of the theme will be used. [...]
final, inherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
createState() → _InkResponseState<InkResponse>
Creates the mutable state for this widget at a given location in the tree. [...]
inherited
debugCheckContext(BuildContext context) bool
Asserts that the given context satisfies the prerequisites for this class. [...]
@mustCallSuper, inherited
debugFillDescription(List<String> description) → void
Add additional information to the given description for use by toString. [...]
inherited
getRectCallback(RenderBox referenceBox) RectCallback
The rectangle to use for the highlight effect and for clipping the splash effects if containedInkWell is true. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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