tapMechanics property

List<TapMechanic>? tapMechanics
final

The tap mechanics to apply to this widget.

Tap mechanics define the visual feedback when the widget is tapped. Multiple mechanics can be combined and will be applied in order (the first mechanic wraps the child, the second wraps the first, etc.).

If null, defaults to RippleTapMechanic for backward compatibility.

Example:

// Single mechanic
Tappable(
  onTap: () {},
  tapMechanics: [ScaleTapMechanic()],
  child: Text('Scale on tap'),
)

// Combined mechanics
Tappable(
  onTap: () {},
  tapMechanics: [
    RippleTapMechanic(splashColor: Colors.blue),
    ScaleTapMechanic(scaleFactor: 0.95),
  ],
  child: Text('Ripple + Scale'),
)

Implementation

final List<TapMechanic>? tapMechanics;