I am trying to cycle through an array of texts based on ListWheelScrollView using onSelectedItemChanged, but the text does not update, however the variable change does appear in the console
I am extending StatefulWidget too
Here is my ListWheelScrollView:
ListWheelScrollView(
onSelectedItemChanged: (i) {
setState(() {
prompt = promptList[i];
devtools.log(prompt);
});
},
...
and my Text widget looks like this:
Text("$prompt",
key: const Key("textKey"),
style: const TextStyle(
color: Color.fromARGB(255, 255, 255, 250))),
),
I defined my variable
promptinside mybuildwidget instead of the class itself, I'll leave this in case someone else makes the same mistake