You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document SweepGradient startAngle and endAngle #166206
As noted previously #23648 SweepGradient's startAngle and endAngle parameters are not well named. Even after reading that issue and experimenting with them, I still don't know exactly how they're supposed to work. With experimentation, I was able to get startAngle and endAngle to do something by setting them to pi/2 and tau-pi/2 (that made it look like the "mirrored" example, but any angle smaller than that seemed to do nothing.
The documentation makes it sound like they're just what you'd expect them to be given their names,
Creates a sweep gradient centered at center that starts at startAngle and ends at endAngle.
startAngle and endAngle should be provided in radians, with zero radians being the horizontal line to the right of the center and with positive angles going clockwise around the center.
but as discussed, there's more to know.
The documentation later says
The behavior before startAngle and after endAngle is described by the tileMode argument. For details, see the TileMode enum.
But startAngle and endAngle are actually not mentioned in the TileMode page.
Hey everyone, after digging into this, the core confusion is that startAngle/endAngle act as color stops, not a clipping path for the arc.
The most effective solution is to combine TileMode.decal with the stops parameter to define the visible portion of the gradient. To position the starting point correctly, like at 12 o'clock, you then just need to add a GradientRotation transform.
I think adding a simple, practical example of this to the documentation would clear this up for good. I'm happy to put together a PR for the doc update if the maintainers agrees. :)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
abhinavs1920 commentedon Jul 19, 2025
Hey everyone, after digging into this, the core confusion is that startAngle/endAngle act as color stops, not a clipping path for the arc.
The most effective solution is to combine TileMode.decal with the stops parameter to define the visible portion of the gradient. To position the starting point correctly, like at 12 o'clock, you then just need to add a GradientRotation transform.
I think adding a simple, practical example of this to the documentation would clear this up for good. I'm happy to put together a PR for the doc update if the maintainers agrees. :)
@makoConstruct @Piinks @danagbemava-nc
SalehTZ commentedon Jul 19, 2025
Hey there beautiful people, I'm not 100% sure if my fix will be good enough but here it goes.
Improve SweepGradient angle and tileMode documentation
Improve SweepGradient angle and tileMode documentation
Improve `SweepGradient` angle and `TileMode` documentation (#172406)
Improve `SweepGradient` angle and `TileMode` documentation (flutter#1…
Improve `SweepGradient` angle and `TileMode` documentation (flutter#1…
Improve `SweepGradient` angle and `TileMode` documentation (flutter#1…
github-actions commentedon Sep 1, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.Improve `SweepGradient` angle and `TileMode` documentation (flutter#1…
Improve `SweepGradient` angle and `TileMode` documentation (flutter#1…
Improve `SweepGradient` angle and `TileMode` documentation (flutter#1…