Skip to content

Instantly share code, notes, and snippets.

@alphamikle
Created January 31, 2021 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphamikle/bb31d7126ef534436a2c235de854534c to your computer and use it in GitHub Desktop.
Save alphamikle/bb31d7126ef534436a2c235de854534c to your computer and use it in GitHub Desktop.
Set word function
/// We enter characters with a delay of 800ms,
/// but if the data from the asynchronous filter (computed / isolate)
/// has not yet arrived, then we are waiting for them
Future<void> _setWord(String word) async {
if (!canPlaceNextLetter) {
await wait(800);
await _setWord(word);
} else {
searchController.value = TextEditingValue(text: word);
await wait(800);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment