I have 20 images that represent the status of the egg, and in my firebase database I have a node named eggs with 20 values depending on those values the image will either be egg0,egg1,egg2,egg3. How can I do it a shorter way?
My database looks like this
eggs
1 : 0 # this should make the first egg be egg0.png
2 : 2 # this should make the 2nd egg be egg2.png
3 : 1 # this should make the 3rd egg be egg1.png
I've tried multiple things but I'm just not familiar with MIT, I've tried to put all the images in a list but don't know how to change their images while looping through them.
As for the database I tried to loop and join the tag and the number it works but is there any shorter way?
For setting the image if it should be egg1, egg2, i tried to do it via putting the values in a list but I think it's not possible to set an image value to the text of it's path and I have to select it manually. Any ideas? Thank you!
You may run into problems if your nodes are number from 1 upwards, Firebase will try to treat this as an array. Suggest use strings for your nodes, e.g. A,B,C... instead of 1,2,3...