I am using flutter BloC
.
I Have Two block need to be applied to the app (Theme and Language).
I used MultiBlocProvider
with Builder
to clear the code as possible.
The problem is when I press the buttons in Localization Screen & The Theme Screen The App NOT Re-Build
but when I restart the app, I found the state I pressed is stored in shared preference
Example The Current State is dark Theme, I press The Light Theme Button, the app is still in dark theme, When I re-started the app, It's is opened in Light Theme.
How can I Solve this problem
I Uploaded the code to GitHub on the following Link
https://github.com/MaxJan2010/flutter_bloc_starting_project
Can anybody help?
The problem that I forgot to pass the variables of appThemeType
& languageCode
So, overriding the props was the solution
In localization state:
@override
List<Object> get props => [languageCode??''];
also here in theme state
@override
List<Object> get props => [appThemeType??''];