Skip to content

Fix LinearProgressIndicator track painting. #173108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ksokolovskyi
Copy link
Contributor

@ksokolovskyi ksokolovskyi commented Aug 1, 2025

Fixes #164538
Fixes #173096
Fixes #173153

Description

  • Adds support for trackGap in indeterminate LinearProgressIndicator
  • Fixes track painting outside of LinearProgressIndicator bounds when trackGap is greater than zero
  • Fixes LinearProgressIndicator track gap painting when value is 0
  • Adds golden tests

Compose ProgressIndicator implementation was used as a reference.

Before After
Determinate (regular)
before after
Determinate (trackGap: 20)
before after
Indeterminate (regular)
before after
Indeterminate (trackGap: 20)
before after

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Aug 1, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an issue where the LinearProgressIndicator track was painting outside of its bounds when a trackGap was specified. The fix involves clamping the track's rectangle coordinates and adding a check for track width before drawing. A regression golden test has also been added.

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #173108 at sha 9ec08fa

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Aug 1, 2025
@ksokolovskyi ksokolovskyi marked this pull request as draft August 2, 2025 20:30
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@dkwingsmt dkwingsmt requested a review from victorsanni August 6, 2025 18:10
@ksokolovskyi ksokolovskyi marked this pull request as ready for review August 11, 2025 13:40
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #173108 at sha 79465a7

@victorsanni victorsanni requested a review from QuncCccccc August 11, 2025 19:29
Copy link
Contributor

@QuncCccccc QuncCccccc left a comment

Choose a reason for hiding this comment

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

I haven't finished my review but thank you so much for your contribution. Overall it looks good! Will take another look! The golden tests look great!

@ksokolovskyi
Copy link
Contributor Author

Hi @QuncCccccc, thanks a lot for your review and suggestions! I added a number of comments to help understand the code. Could you please take a look again when you have time?

@ksokolovskyi ksokolovskyi changed the title Fix LinearProgressIndicator track painting outside of bounds. Fix LinearProgressIndicator track painting. Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files
Projects
None yet
2 participants