Home > other >  Flutter how to insert a variable in text
Flutter how to insert a variable in text

Time:11-12

enter image description here

I do as the documentation says, myLevel is a valiable which is equal to 5 but it does not work

CodePudding user response:

remove const on line 35 as myLevel is a dynamic variable

CodePudding user response:

You can use myLevel.toString() or what you have now. You have the text in a children: const [<Widget>, <Widget>, ...], you will have to remove the const and then add const to all the Widgets that turn red.

  • Related