paintRadialReaction method

void paintRadialReaction (Canvas canvas, Offset offset, Offset origin)

Used by subclasses to paint the radial ink reaction for this control.

The reaction is painted on the given canvas at the given offset. The origin is the center point of the reaction (usually distinct from the point at which the user interacted with the control, which is handled automatically).

Implementation

void paintRadialReaction(Canvas canvas, Offset offset, Offset origin) {
  if (!_reaction.isDismissed) {
    // TODO(abarth): We should have a different reaction color when position is zero.
    final Paint reactionPaint = Paint()..color = activeColor.withAlpha(kRadialReactionAlpha);
    final Offset center = Offset.lerp(_downPosition ?? origin, origin, _reaction.value);
    final double radius = _kRadialReactionRadiusTween.evaluate(_reaction);
    canvas.drawCircle(center + offset, radius, reactionPaint);
  }
}