createBoxPainter method
Returns a BoxPainter that will paint this decoration.
The onChanged
argument configures BoxPainter.onChanged. It can be
omitted if there is no chance that the painter will change (for example,
if it is a BoxDecoration with definitely no DecorationImage).
Implementation
@override
_TriangleDecorationPainter createBoxPainter([VoidCallback? onChanged]) {
assert(onChanged != null || image == null);
Path path = Path();
Paint paint = Paint()..isAntiAlias = true;
return _TriangleDecorationPainter(this, path, paint, onChanged);
}