Flutter & Firebase authentication with streams and StreamBuilder

Andrea Bizzotto • March 7, 2019
Video Thumbnail
Andrea Bizzotto Logo

Andrea Bizzotto

@codewithandrea

About

Tutorials about learning Flutter. Subscribe for regular videos covering all things Flutter, including state management, layouts, testing, and more. About me: I'm Andrea, and I created this channel to help you become a better Flutter developer. You can find more Flutter tutorials beyond my YouTube channel: Website: https://codewithandrea.com/ GitHub: https://github.com/bizz84 Flutter & Firebase Udemy Course (discount code included): https://nnbd.me/flutter-firebase

Video Description

Sign up here for more videos: https://codewithandrea.com/ GitHub code for this project: https://github.com/bizz84/coding-with-flutter-login-demo (or to follow along step-by-step: https://github.com/bizz84/coding-with-flutter-login-demo/releases/tag/update-gradle-and-flutter-1.2) This video is a continuation on my small series on how to build a login flow with Firebase. In this video I show how to use a special stream called onAuthStateChanged, and use it to simplify our widgets logic. This leads to a very elegant solution using StreamBuilder, which I highly recommend when using Firebase authentication. HIGHLIGHTS 00:00 - Intro 00:37 - Getting the latest code from GitHub 01:41 - Overview of the project 03:14 - FirebaseAuth.onAuthStateChanged explained 06:19 - Updating the RootPage with StreamBuilder 09:31 - Removing all the old code 10:18 - Benefits of streams + StreamBuilder 13:07 - Summary & wrap up This code was tested with Flutter stable 1.2. Want more? Check out all my Flutter courses: 👇👇 https://codewithandrea.com/courses/ Thanks for watching!