-
Notifications
You must be signed in to change notification settings - Fork 204
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
Suggestion: Linear indicator should display only part of linear gradient #31
Comments
I understand, you can send a PR making it customizable ;)
…On Sun, Jun 23, 2019, 10:44 AM Shax ***@***.***> wrote:
I believe current implementation of linear gradient does not fit well with
linear percent indicator use case. IMHO indicator should shade only part of
linear gradient (according to progress value), not entire gradient.
For example bellow I specified linear gradient with 4 colors (red, orange,
yellow, green) to create 'VU effect'. Upper progress bar is the way I
believe indicator should render gradient, lower one is current behavior. No
matter what progress value is set entire gradient is visible.
[image: gradient]
<https://user-images.githubusercontent.com/1778875/59978371-eb536b80-95db-11e9-9cd3-5cd814ad99ad.png>
It's just a matter of changing shader offset values in 2 places
https://github.com/diegoveloper/flutter_percent_indicator/blob/afbef0e558d8b6cbfecb45e6d9df7b58d6bbdfda/lib/linear_percent_indicator.dart#L271-L272
https://github.com/diegoveloper/flutter_percent_indicator/blob/afbef0e558d8b6cbfecb45e6d9df7b58d6bbdfda/lib/linear_percent_indicator.dart#L279-L280
I can make a PR but I feel this needs some feedback from you.
Can this functionality at least be available as an option?
Thanks for the great widget!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#31?email_source=notifications&email_token=ABFL3UAY276VNHUYOJP35L3P36K5PA5CNFSM4H2ZGGK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3EZBFA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABFL3UBOMM42Q6J5XXBKISDP36K5PANCNFSM4H2ZGGKQ>
.
|
Should both circular and linear indicators have same option? |
I think it should be available only for Linear, now we have a bug on the
gradient for Circular.
…On Sun, Jun 23, 2019, 1:28 PM Shax ***@***.***> wrote:
Should both circular and linear indicators have same option?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#31?email_source=notifications&email_token=ABFL3UAN5UB65ILLHWFXLW3P366FRA5CNFSM4H2ZGGK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYLEIEA#issuecomment-504775696>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABFL3UBVCJNA6HBDKYJI7DLP366FRANCNFSM4H2ZGGKQ>
.
|
done! and published :) |
Yeah I really need this functionality for the Circular. Any clue how to implement? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe current implementation of linear gradient does not fit well with linear percent indicator use case. IMHO indicator should shade only part of linear gradient (according to progress value), not entire gradient.
For example bellow I specified linear gradient with 4 colors (red, orange, yellow, green) to create 'VU effect'. Upper progress bar is the way I believe indicator should render gradient, lower one is current behavior. No matter what progress value is set entire gradient is visible.
It's just a matter of changing shader offset values in 2 places (original code below)
flutter_percent_indicator/lib/linear_percent_indicator.dart
Lines 271 to 272 in afbef0e
flutter_percent_indicator/lib/linear_percent_indicator.dart
Lines 279 to 280 in afbef0e
I can make a PR but I feel this needs some feedback from you.
Can this functionality at least be available as an option?
Thanks for the great widget!
The text was updated successfully, but these errors were encountered: