Skip to content
0:00 / 0:00

#flutter#bloc#flutter_bloc

Switch Themes with Flutter Bloc - Dynamic Theming Tutorial (Dark & Light Theme)

Reso Coder

114K subscribers • 36 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Reso Coder
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

40K views7 years ago2 recommendations

Mobile developmentSoftware designFlutter and React NativeDesign patterns

Reso Coder demonstrates how to implement dynamic light and dark theme switching in Flutter using the Bloc library.

📗 Learn from the written tutorial & get the code 👇👇 resocoder.com/flutter-switch-themes-bloc 👨‍💻 Do you write good code? Find out now 👇 resocoder.com/good-code-quiz Themes are a sure way to add a vibrant touch to your apps. With Flutter's theming support, you can customize literally everything with only a few lines of code. What if you want to let your users change the themes on the fly though? At the very least, every app should support light and dark mode. One option is to hack something together using StatefulWidgets. Another, and better option, is to use the flutter_bloc library to create an extensible and manageable theme switching framework. Go to the website for more information, code examples, and articles: ● resocoder.com Follow me on social media: ● instagram.com/resocoder ● facebook.com/resocoder ● twitter.com/resocoder

Why it's here

2 people recommend this

What people say. Recommended as a guide for managing dynamic themes and using multiple blocs for granular UI rebuilds.

u/EngineerScientistin r/FlutterDev • Recommends

Switch Themes with Flutter Bloc - Dynamic Theming Tutorial (Dark & Light Theme)

u/felangel1in r/FlutterDev • Recommends

On “What are the advantages and disadvantages of using the flutter_bloc library vs. implementing the BLoC pattern by yourself?”

As others have mentioned, I would recommend having multiple blocs to manage each logical feature/use-case in your application. Then you can wrap the parts of the UI which you want to rebuilt in response to state changes in a BlocBuilder. This approach should give you very granular control over which parts of the UI to rebuild upon state changes and you can go even further by providing an optional condition to BlocBuilder and BlocListener. I would highly recommend going through the documentation at https://bloclibrary.dev and working through some of the example apps and tutorials. Also, ResoCoder has some awesome video tutorials on youtube ([video [video [video [video