I have 2 different cubits in my application. One is a Settings cubit and the other is a homepage cubit.
From the Homepage the user can move to the SettingsPage where settings can be modified.
The Settings cubit is created Above MaterialApp in main.dart to provide it app wide.
What I need to achieve is:
- I must create/load the current settings on app startup. I was thinking about doing this on the cubit constructor but can I emit from a cubit constructor?
- Every time settings are changed (because of the initial settings loaded or modification in settings page), the homepage should reload.
I have all working with the homepage cubit. It listens to changes with a BlocProvider and redraws the UI accordingly. But my problem is how to make it work with the settings cubit.
I could provide some code but there's a lot of unrelated bloc stuff, so I prefer to just expose the problem.