question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[LinearProgressIndicator] Adding track radius causes incorrect progress in the start of the indicator

See original GitHub issue

Description:

Say I set a LinearProgressIndicator to have the following traits:

progressIndicator.progress = positionInMs / 100 // Deci-seconds
progressIndicator.max = durationInMs / 100

This results in a very fine position for the progress indicator.

When there is no track radius set, very low progress amounts (say, 10) look fine:

image

When there is a track radius however, the shown progress is much larger than it should be, presumably to accommodate the track radius (In this example, the track radius is 16dp):

image

Expected behavior:

The progress when there is a track radius should be the same as the progress when there is no track radius. If the progress extent cannot contain the whole track radius, just clip the drawn progress a bit so that it does correctly fit.

I’ve attached a picture below of what I want:

image

Source code: See above.

Android API version: 33

Material Library version: 1.7.0-beta01

Device: OnePlus 7T running LineageOS

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
pubiqqcommented, Aug 29, 2022
0reactions
OxygenCobaltcommented, Aug 31, 2022

Eh, I was just inferring that from what pekingme said about how the library does not clip the progress due to how the base progress class needs to accommodate the circular progress indicator as well, which has no defined “start” or “end” and makes such clipping more difficult.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a border/corner radius to a ... - Stack Overflow
When I replace the LinearProgressIndicator with another widget (e.g. Text ) in the code below, it works, as expected. Container( decoration: new ...
Read more >
LinearProgressIndicator | Android Developers
Sets the current progress to the specified value with/without animation based on the input. void, setTrackCornerRadius(int trackCornerRadius).
Read more >
[CircularProgressIndicator] White/transparent lines on ... - GitHub
Description: When enabling rounded ends on the progress indicator using trackCornerRadius there are fine white/transparent lines at the ...
Read more >
step_progress_indicator | Flutter Package - Pub.dev
Bar indicator made of a series of selected and unselected steps.
Read more >
LinearProgressIndicator class - material library - Dart API
A widget that shows progress along a line. There are two kinds of linear progress indicators: Determinate. Determinate progress indicators have a specific ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found