diegoveloper / flutter_percent_indicator

Flutter percent indicator library
BSD 2-Clause "Simplified" License
679 stars 206 forks source link

1% progress should be inside. #147

Closed flomingdev closed 2 years ago

flomingdev commented 2 years ago

Screenshot 2022-03-16 at 10 46 40 PM The progress should be inside the linear bar. How can we resolve this kind of problem? Does anyone have some workaround solutions? Thanks!

xlDownxl commented 2 years ago

Same problem here.

diegoveloper commented 2 years ago

Can anyone add a minimum code to reproduce the issue?

xlDownxl commented 2 years ago

Here is a static example to reproduce: LinearPercentIndicator( width: 150.0, lineHeight: 20.0, barRadius: Radius.circular(10), percent: 0.05, )

As soon as the percentage goes very low (eg. 0.05 here), the progress bar behaves like shown in the first post.

Thanks for taking on the issue!

diegoveloper commented 2 years ago

Can you add a complete minimum example that I can run here?

xlDownxl commented 2 years ago

I figured out that the problem comes from the barRadius parameter: If the progress bar itself is too small to fit the rounded corner radius, the bar will be displayed erronous.

diegoveloper commented 2 years ago

I figured out that the problem comes from the barRadius parameter: If the progress bar itself is too small to fit the rounded corner radius, the bar will be displayed erronous.

@xlDownxl do you want to send a pull request?

xlDownxl commented 2 years ago

@diegoveloper I only located the problem, I don't have a fix for it. Personally, I am not so familiar with the Drawer, so I am not sure if I can find a solution to this problem soon.

daveleenew commented 2 years ago

Same problem here.

daveleenew commented 2 years ago

這是一個重現的靜態示例: LinearPercentIndicator( width: 150.0, lineHeight: 20.0, barRadius: Radius.circular(10), percent: 0.05, )

一旦百分比變得非常低(例如這裡的 0.05),進度條的行為就像第一篇文章中顯示的那樣。

感謝您處理這個問題!

LinearPercentIndicator( padding: EdgeInsets.zero, lineHeight: 22, percent: 0.05, barRadius: const Radius.circular(16), progressColor: Colors.red, backgroundColor:Colors.grey[200]),

diegoveloper commented 2 years ago

please add a complete minimum example that I can run here

deakjahn commented 2 years ago

@diegoveloper Diego, really no need for an example. Just set your bar in your own example to 1-5 percent.

Small-values

Here's another image. If the percentage value is low, the bar will be drawn outside the background.

deakjahn commented 2 years ago

See https://github.com/diegoveloper/flutter_percent_indicator/pull/154.

All that was needed was to clip the bar with its own background.