I wonder if someone can help me with something that’s driving me up the wall.
I’m very new to flutter and the dart language. Working on a basic personal project as I progress through a Udemy course.
It’s called ‘Bushy Bingo’ – The below is the UI (set aside the layout issues for now) What I want is for the order of the animals to shuffle when the user clicks the shuffle button. So you get a randomized game each time.
The animals are all custom widgets I’ve created which sit within a ‘Table’ widget, 4 Table Rows, 4 children a piece to create the 4 x 4 grid.
My thinking is that I need to
Assign a ‘positionNumber’ value as an into to each cell of the grid
Create an ‘animalIndex’ map containing my 16 animals
Write a for loop function, which creates a tableOrder from scratch on the following logic..
A - For 16 times...
B - Generate a random number between zero and the length of my animalIndex
C - Take the corresponding entry from my animalIndex and add it as a new entry to my tableOrder list
D - Remove the entry from the animalIndex
Assuming that's reasonable logic, i cannot get it to work with dart. Please see the below screenshot to see the issue
If anyone could let me know where I'm going wrong it would be massively appreciated. Maybe my whole approach is wrong. (I've been wrong before ;))

