I’m very new in Flutter (and programing).
I have a BottomSheet that cointains ChoiceChips and some Switches. It all works great but when I close the BottomSheet it does not save the state of the switches and the choice chips.
I’m trying to find a way to keep my choices and the switches state even when I close the BottomSheet.
2
Answers
To save data even when closing the BottomSheet is to save user data such as the values the user selected to do that You must save the data in the parent widget if you’re not using any kind of state management like Provider and flutter_bloc, etc
this code will give you a good example of how to do that, then you can use your customization in the code
If my answer helps don’t forget to vote 🙏️ and make it the accepted answer
Adding Single line to Faisal Faraj Answer
Wraping Choice Chip with Stateful Builder to rebuild showModalBottomSheet for refreshing selection