Created
January 31, 2021 13:56
-
-
Save alphamikle/bb31d7126ef534436a2c235de854534c to your computer and use it in GitHub Desktop.
Set word function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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