Skip to content

Document SweepGradient startAngle and endAngle #166206

@makoConstruct

Description

@makoConstruct

Use case

I'm trying to use SweepGradient

Proposal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions