I'm implementing the BLoC architecture in my app, but I've encountered a situation where I have small widgets that need to refresh to show changes. I feel creating a separate BLoC class or Cubit for these minor updates would just add unnecessary boilerplate code.
For example, when I pop up a modal sheet with a form that includes a switch or a list of chips, I need to refresh their states to reflect whether they're active or inactive.
Is it acceptable to mix in basic state management techniques like setState
or ValueNotifier
for these scenarios? I’d love to hear your thoughts on this and why your answer would be the right approach, as I’m eager to learn more about Flutter.
Thank you!
Use BLoC for parts of your app where state changes need to be communicated across multiple widgets or pages. For small widgets like switches you can use setState() in a stateful widget