Skip to content
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

fix: onRatingUpdate called with wrong state #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asci-00
Copy link

@asci-00 asci-00 commented Nov 26, 2023

Thank you for providing flutter_rating_bar.
There is something I would like to contribute while using this, so I would like to request a PR.

Problem

  • When the iconRating is changed, onRatingUpdate is not called immediately, so if the _rating state changes quickly, the iconRating value referenced by _onDragUpdate / _onDragEnd may not be up to date.

Describe your changes

  • Separated ratingOffset into commonly used states rather than individual methods. (_ratingOffset)
  • IconRating did not seem to need to be dependent on the index, so I modified it to be a getter based on the _rating value independently. It seems to be working well in my code. Could you please give me some feedback on this?
  • Modified the no-rating / half-rating / full-rating conditions by modifying the iconRating calculation method. This part may also be different from what you intended, so please give me feedback and I will correct it.

Issue ticket number and link

#76

@asci-00
Copy link
Author

asci-00 commented Dec 7, 2023

@sarbagyastha Could you review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant