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

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 …

--

--

Flutter Developer | ML | AR

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store