paintFeature method
override
Override this method to paint the ink feature.
The transform argument gives the coordinate conversion from the coordinate system of the canvas to the coordinate system of the referenceBox.
Implementation
@override
void paintFeature(Canvas canvas, Matrix4 transform) {
final int alpha = _fadeInController.isAnimating ? _fadeIn.value : _fadeOut.value;
final Paint paint = Paint()..color = color.withAlpha(alpha);
final Rect? rect = _clipCallback?.call();
// Splash moves to the center of the reference box.
final Offset center = Offset.lerp(
_position,
rect != null ? rect.center : referenceBox.size.center(Offset.zero),
Curves.ease.transform(_radiusController.value),
)!;
paintInkCircle(
canvas: canvas,
transform: transform,
paint: paint,
center: center,
textDirection: _textDirection,
radius: _radius.value,
customBorder: customBorder,
borderRadius: _borderRadius,
clipCallback: _clipCallback,
);
}