In the āPopping the Stackā section, if one has a StatefulWidget one could add setState code to the the IconButton onPressed to reset variables and such. This works great, but is there a way to do this with the ā<ā (back) button?
Iām not that well versed in Flutter internals, but if youāre talking about the general back button on Android or iOS, you could always override the default navigation, by adding your own leading element for the back button.
Other than that, you could pass in the āonWillPopā callback, which notifies you when a widget is about to be popped. In that case, you could reset the state before popping, and then return ātrueā, to allow the Widget to be popped!
Thanks @filbabic. I came up with a solution which works, but not sure if it is the best solution. Iāll take a look at the onWilllPop callback as it might be better than what I did. Iām still learning.