#4 Dymanic Theming in Flutter App (Flutter Series by Akshit Madan)

Akshit Madan
Oct 26, 2020

--

Hey there , in this module we are going to see how we can switch between dark and light theme in our flutter app.

We are going to use BLoC pattern to listen to the boolean value of dark theme. Class Bloc takes input of the drawer switch , if switch is off then it provides false sink to Class Bloc and if the switch is on then it provides true Stream to Class Bloc.

Material app is wrapped with a Stream Builder which listens to the output Stream from Bloc Class and sets the theme accordingly.

main.dart

Now its time for you to code !!

Thanks for reading …

--

--

Akshit Madan

Founder @Resumepal | Software Engineer | AI & LLMs | Flutter