Flutter Themes With Provider
Hi Coders,
Welcome back,
Have you ever used themes in your App because now a days almost every app comes with Themes switch function(Light Theme and Dark Theme) and as a Mobile Application Developer you must know how it works and How to implement this in our app.
If you are looking for video then check out my YouTube Channel
So Here i am gonna use Provider for theme switch and the reason behind this is I hate Provider But as a state management But when its about changing theme then Provider is the best So now let's see how it will work
Step 1: Add Provider to Pubspec.yaml file
Step 2: Create a new file named themes.dart for themes structure i.e here you can define what and how you want to show your data and UI when themes changing.
Step 4: Initialize provider in main.dart file
Step 5: Change theme with switch button