Created
July 26, 2022 18:28
-
-
Save Mufaddal1125/501c2e33c6415bd1782e637766e8bef9 to your computer and use it in GitHub Desktop.
create_keys
This file contains hidden or 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
// list of fruits | |
var fruits = [ | |
'Apple', | |
'Banana', | |
'Cherry', | |
'Grape', | |
'Kiwi', | |
'Mango', | |
'Orange', | |
'Pear', | |
'Strawberry', | |
'Watermelon', | |
'Elderberry', | |
'Eggfruit', | |
'Evergreen', | |
'Huckleberry', | |
'Entawak', | |
'Grapefruit', | |
'Grapes', | |
'Gooseberries', | |
'Guava', | |
'Honeydew', | |
'Kumquat', | |
'Lemon', | |
'Lime', | |
'Lychee', | |
'Mandarina', | |
'Mango', | |
]; | |
// create list of global keys | |
List<GlobalKey> _fruitKeys = []; | |
@override | |
void initState() { | |
// add key for each fruit to _fruitKeys | |
_fruitKeys = fruits.map((e) => GlobalKey()).toList(); | |
super.initState(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment