createShader method
Creates a ui.Gradient.linear
with duplicated colors
and stops
.
Implementation
@override
Shader createShader(Rect rect, {TextDirection? textDirection}) =>
ui.Gradient.linear(
begin.resolve(textDirection).withinRect(rect),
end.resolve(textDirection).withinRect(rect),
_duplicateEntries(colors),
_duplicateEntries(_impliedStops(colors.length))
..remove(0)
..removeLast(),
tileMode,
_resolveTransform(transform, rect, textDirection),
);