I have a field in a form that takes in a username. When this value changes, some asynchronous work runs. Right now the asynchronous work is firing on every letter change. How do I make it so that it only fires some amount of seconds after the user has changed the field and when the user isn’t making any more changes?
TextField(
controller: userController,
onChanged: (text) {
asyncWorkThatDoesntNeedToBeAwaited(text);
},
),
>Solution :
There is a package name easy_debounce.
Here is an example of it in use – repo