The problem is that in the State object's constructor I cannot yet access the widget final variables. This is why I passed them down in the custom constructor parameter. But now that is a no-no. So now I'll convert state variables to late and initialize them in initState. That might be a slippery slope because back in the past rarely I got run-time crashes because it wasn't satisfactory for the Flutter framework to init late variables in the initState, maybe initState was too lengthy and it took too long, so it was too late? Right now for Deal-O-Round it seems to work.
This refactor can have consequences. Ref https://dart.dev/tools/linter-rules/no_logic_in_create_state Ref https://stackoverflow.com/questions/50818770/passing-data-to-a-stateful-widget-in-flutter
The problem is that in the State object's constructor I cannot yet access the
widget
final variables. This is why I passed them down in the custom constructor parameter. But now that is a no-no. So now I'll convert state variables tolate
and initialize them ininitState
. That might be a slippery slope because back in the past rarely I got run-time crashes because it wasn't satisfactory for the Flutter framework to init late variables in theinitState
, maybe initState was too lengthy and it took too long, so it was too late? Right now for Deal-O-Round it seems to work.