Index out of range - Change text dynamically from app states

Actions & Logic

Hello everyone, first of all, i am still a newbie and sorry if the question has already been answered or is easy to attain, i searched on my own and i can't find the solution, so here i am :

My goal is to make a game mobile app that can give dares to people in function of the place and their preferences.

My issue is i want to change a text widget dynamically from an app state that is chosen randomly

What have you tried so far?

Here is my tentative :
1 - make a data type for the dares , with the description of the dare, the difficulty (from 1 to 10), and tags to sort the dares, with placetags and type tags

2 - in the app states, i made a list for each difficulty, i wanted to do that for sorting them later in individual containers, eahc sorted by difficulty

and i filled manually some of the dares to test it out, here we can see on dare on the app state "DaresList1"


3 - another app state with an integer to make the random function

4- then in the text i wanted it to choose from a specific index from the app state "DaresList1", then when specifing the index, i have choosen the random integer, which the limit is set by the number of items in the app state

thanks in advance for the help, if you have any questions feel free to ask !

Did you check FlutterFlow's Documentation for this topic?
Yes
1
1 reply