0

My app has a screen that is composed of several buttons and text labels which are conditionally visible based on the selection of the buttons (for example, a yes/no radio button asking whether you were exposed to a covid-positive individual, which would cause another radio button asking whether the encounter lasted more than 15 minutes to be displayed).

  1. I know that stateless widgets for screens are preferable due to their improved performance, so I am trying to keep the screen widget stateless
  2. The radio buttons in the example are actually custom statefull widgets wrapping a ToggleButton, so I would have the condition (controlling the visibility of widget) to flow between the main stateless widget and the statefull child widgets (with the toggle buttons)
inq
  • 183
  • 1
  • 3
  • 10
  • You can use packages like Provider & GetX – Darshan Feb 01 '21 at 18:29
  • thanks. I was't aware of GetX. It seems great. definitely adopting it. I would appreciate a short code snippet that demonstrates enabling and hiding a button in a stateless widget based on a state of another child widget – inq Feb 02 '21 at 00:50

0 Answers0