-1

I have a text field(stateless widget) and a set of radio buttons(Stateful widget). This text field displays different data, depending on the item selected in the radio button.

In such a case, the property of the text field is changing. So what will we say about its state? stateful? or still stateless?

Annapurna
  • 529
  • 1
  • 6
  • 19

1 Answers1

1

I would make the textfield and radio buttons in one widget and make that one Statefull. If a radio button is beeing pressed call the setState() method.

leguan
  • 88
  • 8
  • Best way. Create your own StatefulWidget, then but in the build method the textfield and the radio buttons. – il_boga Jul 27 '22 at 09:53