Created
January 31, 2021 13:55
-
-
Save alphamikle/edc2f87bab20850bdd24bece61117116 to your computer and use it in GitHub Desktop.
Search 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
/// Function that launches a test script | |
/// for entering characters into a text input | |
Future<void> _testSearch() async { | |
List<String> words = items.map((Item item) => item.profile.replaceAll('https://opencollective.com/', '')).toSet().toList(); | |
words = words | |
.map((String word) { | |
final String newWord = word.substring(0, min(word.length, 3)); | |
return newWord; | |
}) | |
.toSet() | |
.take(3) | |
.toList(); | |
/// Start the frame counter | |
_startFpsMeter(); | |
for (String word in words) { | |
final List<String> letters = word.split(''); | |
String search = ''; | |
for (String letter in letters) { | |
search += letter; | |
await _setWord(search); | |
} | |
while (search.isNotEmpty) { | |
search = search.substring(0, search.length - 1); | |
await _setWord(search); | |
} | |
} | |
/// Stop the frame counter | |
_stopFpsMeter(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment