Skip to content

Conversation

@SalehTZ
Copy link
Contributor

@SalehTZ SalehTZ commented Jul 19, 2025

Improve SweepGradient and TileMode Documentation

Description

This PR enhances the documentation for SweepGradient and TileMode to provide clearer guidance on how angles are measured and how tile modes affect sweep gradient rendering.

Changes

  1. SweepGradient Documentation:

    • Clarified angle measurement in radians from the positive x-axis
    • Documented angle normalization behavior for values outside [0, 2π]
    • Added detailed explanations of how each TileMode affects rendering outside the angular sector
  2. Gradient.sweep Constructor:

    • Improved parameter documentation
    • Added a practical example showing how to create a 90-degree sweep gradient
    • Clarified the relationship between color stops and angles
  3. TileMode Documentation:

    • Added sweep gradient-specific behavior to each TileMode variant
    • Clarified how each mode (clamp, repeated, mirror, decal) affects rendering outside the angular sector
    • Improved overall documentation structure for gradient edge behavior

Related Issues

Fixes #166206

Testing

  • Verified documentation changes by reviewing the generated API docs
  • Ensured all examples compile and render as expected

Breaking Changes

None - this is purely a documentation improvement.

Additional Notes

The changes make it much clearer how startAngle and endAngle interact with different TileMode values, which was a source of confusion in the original issue.

Pre-launch Checklist

SalehTZ added 2 commits July 19, 2025 10:05
- Clarify angle measurement in radians from positive x-axis
- Document angle normalization behavior for values outside [0, 2π]
- Explain how tileMode affects rendering outside the angular sector
- Add detailed descriptions of each tileMode's effect on sweep gradients
- Fixes flutter#166206
- Clarify angle measurement in radians from positive x-axis
- Document angle normalization behavior for values outside [0, 2π]
- Explain how tileMode affects rendering outside the angular sector
- Add detailed descriptions of each tileMode's effect on sweep gradients
- Fixes flutter#166206
@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. labels Jul 19, 2025
SalehTZ added 4 commits July 19, 2025 10:30
- Restored ImageFilter documentation
- Added detailed sweep gradient behavior for each TileMode
- Clarified how tileMode affects rendering outside the angular sector
- Maintained all existing documentation for other gradient types
@abhinavs1920
Copy link

@SalehTZ Awesome work on this PR! This is the perfect fix.

Clarifying the coordinate system and adding that example using TileMode.decal is exactly what was needed. This will save a lot of developers from future headaches.

Looks great to me. Nice job!

@SalehTZ
Copy link
Contributor Author

SalehTZ commented Jul 20, 2025

umm, I cannot understand why this test fails. Can anyone help?

@chinmaygarde chinmaygarde removed the engine flutter/engine related. See also e: labels. label Jul 21, 2025
@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Jul 22, 2025
@justinmc justinmc requested a review from victorsanni July 22, 2025 22:08
SalehTZ and others added 2 commits July 26, 2025 08:59
Co-authored-by: Victor Sanni <[email protected]>
Co-authored-by: Victor Sanni <[email protected]>
@SalehTZ
Copy link
Contributor Author

SalehTZ commented Aug 9, 2025

Google test failed! :(
IDK if I push the changes, Google test logs will disappear or not, so here they are.

[Thu, 07 Aug 2025 18:52:13 UTC] Pull request has been added to the roll queue

[Thu, 07 Aug 2025 18:56:04 UTC] Started creating a ChangeList (internal PR) in Google codebase. This step takes about 30 minutes.
If a changelist is created successfully, you will receive another update.

[Thu, 07 Aug 2025 18:56:34 UTC] http://cl/792251855 (only visible to Googlers) has been created for testing

[Thu, 07 Aug 2025 18:56:40 UTC] Google testing has started...

[Thu, 07 Aug 2025 19:36:45 UTC] Google testing failed.
Please contact a Google developer to investigate.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renewing my LGTM 👍 . Thanks for fixing the nits.

I assume the Google test failures were a fluke since this is a docs-only change. I'll autosubmit this.

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 11, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 11, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Aug 11, 2025

autosubmit label was removed for flutter/flutter/172406, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@SalehTZ
Copy link
Contributor Author

SalehTZ commented Aug 12, 2025

Thanks everybody for your attention and reviews.

Could it be failing because of the engine label?

@justinmc
Copy link
Contributor

The failing test looked like a timeout so I reran it.

@SalehTZ
Copy link
Contributor Author

SalehTZ commented Aug 16, 2025

Phew, now it's green.

@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 16, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Aug 16, 2025
Merged via the queue into flutter:master with commit 0a2906b Aug 16, 2025
180 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 16, 2025
flutter/flutter@52af7a5...0a2906b

2025-08-16 [email protected] Improve `SweepGradient` angle and `TileMode` documentation (flutter/flutter#172406)
2025-08-16 [email protected] Roll Skia from 1e148cada9d4 to 16dbd908dcab (1 revision) (flutter/flutter#173901)
2025-08-16 [email protected] Roll Skia from 91ad1f21ca61 to 1e148cada9d4 (3 revisions) (flutter/flutter#173890)
2025-08-16 [email protected] Roll Dart SDK from 9277d6303da5 to 67ca79475db6 (1 revision) (flutter/flutter#173886)
2025-08-15 [email protected] Blocks exynos9820 chip from vulkan (flutter/flutter#173807)
2025-08-15 [email protected] Revert "[ios][tools]do not log "bonjour not found" at all (unless verbose)" (flutter/flutter#173879)
2025-08-15 [email protected] Roll `package:analyzer` forward to `8.1.1` (flutter/flutter#173867)
2025-08-15 [email protected] Roll Skia from 2f66be8a593a to 91ad1f21ca61 (3 revisions) (flutter/flutter#173877)
2025-08-15 [email protected] [a11y] : set isFocused will update isFocusable to true (flutter/flutter#170935)
2025-08-15 [email protected] Reland predictive back route transitions by default (flutter/flutter#173860)
2025-08-15 [email protected] Roll Fuchsia Linux SDK from zWRpLglb48zC1vZLv... to H1kVA85LyQsK8EDp2... (flutter/flutter#173874)
2025-08-15 [email protected] Add onHover callback support for TableRowInkWell (flutter/flutter#173373)
2025-08-15 [email protected] Roll Skia from 5654ac32ede0 to 2f66be8a593a (6 revisions) (flutter/flutter#173866)
2025-08-15 [email protected] Roll Dart SDK from cc008dc8e7aa to 9277d6303da5 (2 revisions) (flutter/flutter#173864)
2025-08-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Implements the Android native stretch effect as a fragment shader (Impeller-only). (#169293)" (flutter/flutter#173865)
2025-08-15 [email protected] Re-add `Linux_android_emu *` tests that had KVM issues, now resolved (flutter/flutter#173812)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…72406)

# Improve SweepGradient and TileMode Documentation

## Description
This PR enhances the documentation for `SweepGradient` and `TileMode` to
provide clearer guidance on how angles are measured and how tile modes
affect sweep gradient rendering.

### Changes
1. **SweepGradient Documentation**:
   - Clarified angle measurement in radians from the positive x-axis
   - Documented angle normalization behavior for values outside [0, 2π]
- Added detailed explanations of how each `TileMode` affects rendering
outside the angular sector

2. **Gradient.sweep Constructor**:
   - Improved parameter documentation
- Added a practical example showing how to create a 90-degree sweep
gradient
   - Clarified the relationship between color stops and angles

3. **TileMode Documentation**:
   - Added sweep gradient-specific behavior to each `TileMode` variant
- Clarified how each mode (clamp, repeated, mirror, decal) affects
rendering outside the angular sector
   - Improved overall documentation structure for gradient edge behavior

## Related Issues
Fixes flutter#166206

## Testing
- Verified documentation changes by reviewing the generated API docs
- Ensured all examples compile and render as expected

## Breaking Changes
None - this is purely a documentation improvement.

## Additional Notes
The changes make it much clearer how `startAngle` and `endAngle`
interact with different `TileMode` values, which was a source of
confusion in the original issue.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victor Sanni <[email protected]>
WillBLogical pushed a commit to WillBLogical/packages that referenced this pull request Aug 20, 2025
…r#9836)

flutter/flutter@52af7a5...0a2906b

2025-08-16 [email protected] Improve `SweepGradient` angle and `TileMode` documentation (flutter/flutter#172406)
2025-08-16 [email protected] Roll Skia from 1e148cada9d4 to 16dbd908dcab (1 revision) (flutter/flutter#173901)
2025-08-16 [email protected] Roll Skia from 91ad1f21ca61 to 1e148cada9d4 (3 revisions) (flutter/flutter#173890)
2025-08-16 [email protected] Roll Dart SDK from 9277d6303da5 to 67ca79475db6 (1 revision) (flutter/flutter#173886)
2025-08-15 [email protected] Blocks exynos9820 chip from vulkan (flutter/flutter#173807)
2025-08-15 [email protected] Revert "[ios][tools]do not log "bonjour not found" at all (unless verbose)" (flutter/flutter#173879)
2025-08-15 [email protected] Roll `package:analyzer` forward to `8.1.1` (flutter/flutter#173867)
2025-08-15 [email protected] Roll Skia from 2f66be8a593a to 91ad1f21ca61 (3 revisions) (flutter/flutter#173877)
2025-08-15 [email protected] [a11y] : set isFocused will update isFocusable to true (flutter/flutter#170935)
2025-08-15 [email protected] Reland predictive back route transitions by default (flutter/flutter#173860)
2025-08-15 [email protected] Roll Fuchsia Linux SDK from zWRpLglb48zC1vZLv... to H1kVA85LyQsK8EDp2... (flutter/flutter#173874)
2025-08-15 [email protected] Add onHover callback support for TableRowInkWell (flutter/flutter#173373)
2025-08-15 [email protected] Roll Skia from 5654ac32ede0 to 2f66be8a593a (6 revisions) (flutter/flutter#173866)
2025-08-15 [email protected] Roll Dart SDK from cc008dc8e7aa to 9277d6303da5 (2 revisions) (flutter/flutter#173864)
2025-08-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Implements the Android native stretch effect as a fragment shader (Impeller-only). (#169293)" (flutter/flutter#173865)
2025-08-15 [email protected] Re-add `Linux_android_emu *` tests that had KVM issues, now resolved (flutter/flutter#173812)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
SydneyBao pushed a commit to SydneyBao/flutter that referenced this pull request Aug 22, 2025
…72406)

# Improve SweepGradient and TileMode Documentation

## Description
This PR enhances the documentation for `SweepGradient` and `TileMode` to
provide clearer guidance on how angles are measured and how tile modes
affect sweep gradient rendering.

### Changes
1. **SweepGradient Documentation**:
   - Clarified angle measurement in radians from the positive x-axis
   - Documented angle normalization behavior for values outside [0, 2π]
- Added detailed explanations of how each `TileMode` affects rendering
outside the angular sector

2. **Gradient.sweep Constructor**:
   - Improved parameter documentation
- Added a practical example showing how to create a 90-degree sweep
gradient
   - Clarified the relationship between color stops and angles

3. **TileMode Documentation**:
   - Added sweep gradient-specific behavior to each `TileMode` variant
- Clarified how each mode (clamp, repeated, mirror, decal) affects
rendering outside the angular sector
   - Improved overall documentation structure for gradient edge behavior

## Related Issues
Fixes flutter#166206

## Testing
- Verified documentation changes by reviewing the generated API docs
- Ensured all examples compile and render as expected

## Breaking Changes
None - this is purely a documentation improvement.

## Additional Notes
The changes make it much clearer how `startAngle` and `endAngle`
interact with different `TileMode` values, which was a source of
confusion in the original issue.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victor Sanni <[email protected]>
SydneyBao pushed a commit to SydneyBao/flutter that referenced this pull request Aug 22, 2025
…72406)

# Improve SweepGradient and TileMode Documentation

## Description
This PR enhances the documentation for `SweepGradient` and `TileMode` to
provide clearer guidance on how angles are measured and how tile modes
affect sweep gradient rendering.

### Changes
1. **SweepGradient Documentation**:
   - Clarified angle measurement in radians from the positive x-axis
   - Documented angle normalization behavior for values outside [0, 2π]
- Added detailed explanations of how each `TileMode` affects rendering
outside the angular sector

2. **Gradient.sweep Constructor**:
   - Improved parameter documentation
- Added a practical example showing how to create a 90-degree sweep
gradient
   - Clarified the relationship between color stops and angles

3. **TileMode Documentation**:
   - Added sweep gradient-specific behavior to each `TileMode` variant
- Clarified how each mode (clamp, repeated, mirror, decal) affects
rendering outside the angular sector
   - Improved overall documentation structure for gradient edge behavior

## Related Issues
Fixes flutter#166206

## Testing
- Verified documentation changes by reviewing the generated API docs
- Ensured all examples compile and render as expected

## Breaking Changes
None - this is purely a documentation improvement.

## Additional Notes
The changes make it much clearer how `startAngle` and `endAngle`
interact with different `TileMode` values, which was a source of
confusion in the original issue.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victor Sanni <[email protected]>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…72406)

# Improve SweepGradient and TileMode Documentation

## Description
This PR enhances the documentation for `SweepGradient` and `TileMode` to
provide clearer guidance on how angles are measured and how tile modes
affect sweep gradient rendering.

### Changes
1. **SweepGradient Documentation**:
   - Clarified angle measurement in radians from the positive x-axis
   - Documented angle normalization behavior for values outside [0, 2π]
- Added detailed explanations of how each `TileMode` affects rendering
outside the angular sector

2. **Gradient.sweep Constructor**:
   - Improved parameter documentation
- Added a practical example showing how to create a 90-degree sweep
gradient
   - Clarified the relationship between color stops and angles

3. **TileMode Documentation**:
   - Added sweep gradient-specific behavior to each `TileMode` variant
- Clarified how each mode (clamp, repeated, mirror, decal) affects
rendering outside the angular sector
   - Improved overall documentation structure for gradient edge behavior

## Related Issues
Fixes flutter#166206

## Testing
- Verified documentation changes by reviewing the generated API docs
- Ensured all examples compile and render as expected

## Breaking Changes
None - this is purely a documentation improvement.

## Additional Notes
The changes make it much clearer how `startAngle` and `endAngle`
interact with different `TileMode` values, which was a source of
confusion in the original issue.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victor Sanni <[email protected]>
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…72406)

# Improve SweepGradient and TileMode Documentation

## Description
This PR enhances the documentation for `SweepGradient` and `TileMode` to
provide clearer guidance on how angles are measured and how tile modes
affect sweep gradient rendering.

### Changes
1. **SweepGradient Documentation**:
   - Clarified angle measurement in radians from the positive x-axis
   - Documented angle normalization behavior for values outside [0, 2π]
- Added detailed explanations of how each `TileMode` affects rendering
outside the angular sector

2. **Gradient.sweep Constructor**:
   - Improved parameter documentation
- Added a practical example showing how to create a 90-degree sweep
gradient
   - Clarified the relationship between color stops and angles

3. **TileMode Documentation**:
   - Added sweep gradient-specific behavior to each `TileMode` variant
- Clarified how each mode (clamp, repeated, mirror, decal) affects
rendering outside the angular sector
   - Improved overall documentation structure for gradient edge behavior

## Related Issues
Fixes flutter#166206

## Testing
- Verified documentation changes by reviewing the generated API docs
- Ensured all examples compile and render as expected

## Breaking Changes
None - this is purely a documentation improvement.

## Additional Notes
The changes make it much clearer how `startAngle` and `endAngle`
interact with different `TileMode` values, which was a source of
confusion in the original issue.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victor Sanni <[email protected]>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…72406)

# Improve SweepGradient and TileMode Documentation

## Description
This PR enhances the documentation for `SweepGradient` and `TileMode` to
provide clearer guidance on how angles are measured and how tile modes
affect sweep gradient rendering.

### Changes
1. **SweepGradient Documentation**:
   - Clarified angle measurement in radians from the positive x-axis
   - Documented angle normalization behavior for values outside [0, 2π]
- Added detailed explanations of how each `TileMode` affects rendering
outside the angular sector

2. **Gradient.sweep Constructor**:
   - Improved parameter documentation
- Added a practical example showing how to create a 90-degree sweep
gradient
   - Clarified the relationship between color stops and angles

3. **TileMode Documentation**:
   - Added sweep gradient-specific behavior to each `TileMode` variant
- Clarified how each mode (clamp, repeated, mirror, decal) affects
rendering outside the angular sector
   - Improved overall documentation structure for gradient edge behavior

## Related Issues
Fixes flutter#166206

## Testing
- Verified documentation changes by reviewing the generated API docs
- Ensured all examples compile and render as expected

## Breaking Changes
None - this is purely a documentation improvement.

## Additional Notes
The changes make it much clearer how `startAngle` and `endAngle`
interact with different `TileMode` values, which was a source of
confusion in the original issue.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victor Sanni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document SweepGradient startAngle and endAngle

6 participants