Skip to content

Instantly share code, notes, and snippets.

@alphamikle
Created January 31, 2021 13:54
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/ab0c8570c7cac4aad3c9a3c7ace98e08 to your computer and use it in GitHub Desktop.
Save alphamikle/ab0c8570c7cac4aad3c9a3c7ace98e08 to your computer and use it in GitHub Desktop.
Cache items function
/// Function for creating a copy of elements
/// used as source for filtering
void cacheItems() {
_notFilteredItems.clear();
final List<Item> multipliedItems = [];
for (int i = 0; i < 10; i++) {
multipliedItems.addAll(items);
}
_notFilteredItems.addAll(multipliedItems);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment