createShader method

  1. @override
Shader createShader (Rect rect, { TextDirection textDirection })
override

Creates a Shader for this gradient to fill the given rect.

If the gradient's configuration is text-direction-dependent, for example it uses AlignmentDirectional objects instead of Alignment objects, then the textDirection argument must not be null.

Implementation

@override
Shader createShader(Rect rect, { TextDirection textDirection }) {
  return ui.Gradient.radial(
    center.resolve(textDirection).withinRect(rect),
    radius * rect.shortestSide,
    colors, _impliedStops(), tileMode,
    null, // transform
    focal == null  ? null : focal.resolve(textDirection).withinRect(rect),
    focalRadius * rect.shortestSide,
  );
}