Home > Enterprise >  How to put variable text and custom text together in flutter
How to put variable text and custom text together in flutter

Time:11-23

If there is an inherited variable called id, I would like to display widget.index and ": problem number" together on one line on the screen.

ex) problem(text) 1(list variable)

problem(text) 2(list variable)

Is there a way to get a variable in a list like the one above and display it on the screen along with text?

CodePudding user response:

You can use $ in a string

      String someString = 'problem id: ${problem(text)} and widget index :${widget.index}';
  • Related