Create a class to fetch the current theme state from shared preference. Add methods to read, write & delete data to and from shared preference.
Add a class to contain ThemeData for light and dark mode. Add method to get current theme. Add methods to set light theme and set dark theme. Store the state to shared preference using the above class you created.
Dark mode will look something like this:
Hex code for
black
used:#000000
How to implement dark mode?
shared preference
. Add methods to read, write & delete data to and fromshared preference
.ThemeData
for light and dark mode. Add method to get current theme. Add methods to set light theme and set dark theme. Store the state toshared preference
using the above class you created.