toPaint method

  1. @override
Paint toPaint(
  1. Rect rect, {
  2. TextDirection? textDirection,
})
override

Returns a Paint for this brush to fill the given rect.

Implementation

@override
Paint toPaint(Rect rect, {TextDirection? textDirection}) {
  return Paint()
    ..isAntiAlias = true
    ..style = PaintingStyle.fill
    ..shader = gradient.createShader(rect, textDirection: textDirection);
}