debounce_throttle_function 1.0.0 debounce_throttle_function: ^1.0.0 copied to clipboard
A new Flutter package project.
TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them.
About #
CommonStreamUtils extends the capabilities of Dart Streams and RxDart.
Dart comes with decent and powerful Streams API out-of-the-box,but they are clumsy to implement some features like:debounce、throttle
Now you can use it easily and gracefully in just one line of code!
Getting started #
🌹🌹Please click the 👍thumb up button, Let's Make Flutter Easy Again!
Features #
Function | Purpose |
---|---|
Throttle | Wait for changes to stop before notifying. |
Debounce | Notifies once per Duration for a value that keeps changing. |
Usage #
For Example: throttle user button click down to 1000milliseconds(1 click per second)
onPressed: () {
CommonStreamUtils.throttleFunction(() {
InviteDialog.show()
},milliseconds: 1000);
},
For Example: debounce user button click down to 1000milliseconds(1 click per second)
onPressed: () {
CommonStreamUtils.debounceFunction(() {
InviteDialog.show()
},milliseconds: 1000);
},
Additional information #
TODO: Tell users more about the package: where to find more information, how to contribute to the package, how to file issues, what response they can expect from the package authors, and more.