I am very much new to the mobx
and want to use it as state management for my application.
so far with the online tutorial and google search I know that mobx
is the state management tool similar to ChangeNotifier
in the flutter and best used with provider
to elegantly manage the state of the widget.
So far, it makes sense to manage the state screen wise:- for that I create the store
which will only be a concern for this screen only, and after declaring the @observable
state variables, I wire them up with business logic and provide it to the concerned screen.
But there are states which have to be managed across the screen, where the state of the current screen is dependent on the state of the previous screen.
So, what is the best way to manage the state across the screen using Mobx? For now, I would create one global Store
(the reason it is global because I want to access this store
in the individual screen store also for some business logic) which will be available across multiple screens made available using provider.
And used in the individual Store
to manage the state.
But somehow making state global doesn't seem right? so, what is a possible solution for this? what is the most elegant way to manage state across multiple screens in flutter using mobx
?