paintFeature method Null safety
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) {
assert(_animationController.isAnimating);
// InkSparkle can only paint if its shader has been compiled.
if (_InkSparkleFactory._shaderManager == null) {
// Skipping paintFeature because the shader it relies on is not ready to
// be used. InkSparkleFactory.compileShaderIfNeccessary must complete
// before InkSparkle can paint.
return;
}
canvas.save();
_transformCanvas(canvas: canvas, transform: transform);
if (_clipCallback != null) {
_clipCanvas(
canvas: canvas,
clipCallback: _clipCallback!,
textDirection: _textDirection,
customBorder: _customBorder,
borderRadius: _borderRadius,
);
}
final Paint paint = Paint()..shader = _createRippleShader();
if (_clipCallback != null) {
canvas.drawRect(_clipCallback!(), paint);
} else {
canvas.drawPaint(paint);
}
canvas.restore();
}