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

onQtyChanged and longpress only when longrpess ends #62

Open
BearAndBunny opened this issue Aug 14, 2024 · 1 comment
Open

onQtyChanged and longpress only when longrpess ends #62

BearAndBunny opened this issue Aug 14, 2024 · 1 comment

Comments

@BearAndBunny
Copy link

Is it possible to add an option, so that onQtyChanged is called only when a lonpress ends, instead of being called continuously?
The reason is that I want to change the qantity in a Cubit that triggers a reapaint of widgets and also set the value in a database table. For this, I'm only interested in the final quantity value, when the user stops increasing the value.

@pmatatias
Copy link
Owner

thank you for using this package.
I understand your need. is it possible to handle it from your cubit?

I have less experiance with bloc state management. as per my knowledge , we can control when the widget rebuild.
for example, call setState means we need to rebuild.

this is update the value but not rebuild the widget

void updateVal (int newVal) {
  myVal = newVal
}

this is update value, and rebuild widget with new value

void updateVal (int newVal) {
  setState((){
       myVal = newVal
  })
}

same like notifyListeners() . when you call this in you function, this will rebuild related component in your UI.

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

No branches or pull requests

2 participants