Streams can be used in complex ways for complex problems, but they can also be used in simple ways! In this episode, I'll show you how to use streams for switching themes of a Flutter application. We will start by defining a boolean store to hold the current selected theme (Dark or Light). Then, we will add a button to our element that will trigger the theme switch. Finally, we will observer our application and react to the changes in the store via the exposed stream. As a bonus, we will slightly refactor our application using some convenience classes from the Sprinkle library.
Flutter in Practice is a free programming course that teaches how to write a mobile application using Flutter framework and Dart programming language. Instead of teaching concepts and ideas in both Flutter and Dart, this course showcases a process of building an actual, mobile application. Our goal is to create an email client that supports the JMAP protocol.
Flutter from A to Z is 12-week course about Flutter (work-in-progress). Subscribe for updates:
https://landing.mailerlite.com/webfor...
Join the Discord channel: / discord
Follow me on Twitter: / zaiste
#flutter #streams #tutorial
Watch video Dynamic Themes Switching (Dark / Light) with Streams - Flutter in Practice 48 online without registration, duration hours minute second in high quality. This video was added by user Zaiste Programming 04 August 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,143 once and liked it 64 people.