Flutter & Firebase App Tutorial #9 - Signing Out
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they were following when their Flutter Firebase sign-out code threw errors or silently failed, especially after package updates.
Recommended by 0 people across 0 different months, 2020 to 2021.
What it is
A 9-minute episode of the Net Ninja's Flutter and Firebase tutorial series showing how to sign out with Firebase Auth and switch between screens when the auth state changes. It is part of a beginner-friendly course with accompanying code on GitHub.
What people said
Cites Nuqo · 2020-11 · Stack Overflow · on “signOut of user in Flutter using Firebase authentication is not working”
I followed this tutorial-series on Youtube step by step ( videolink [this video] ) and already searched for similar questions but my code just isn't working. I already made sure that everything is async & watched the tutorial more than twice but I can't find the problem source. Also, logging in and registering is working fine. What am I doing wrong here? Here's my code: main.dart: void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp( MyApp()); } ... return StreamProvider<UserModel>.value( value: AuthService().user, child: MaterialApp( ... userModel.dart: class UserModel { String uid; String displayName; String avatarUrl; UserModel(this.uid, {this.d
Cites LWB · 2021-04 · Stack Overflow · on “Why is Firebase not signing me out?”
The problem So I am trying to create a flutter app with Firebase and I am following this tutorial series: [LINK] and I am on this video: [this video] whenever I run my code and click the sign out button this appears in the debug console: D/FirebaseAuth( 6371): Notifying id token listeners about a sign-out event. D/FirebaseAuth( 6371): Notifying auth state listeners about a sign-out event. and I am not sent to the sign in screen as I should. This is the code for the page where you sign out: import 'package:flutter/material.dart'; import 'package:my_planner/services/auth.dart'; class SettingsPage extends StatefulWidget { @override _SettingsPageState createState() => _SettingsPageState(); } class _S
Cites DoganKarakus · 2021-11 · Stack Overflow · on “Flutter Firebase Authentication: Signout gives the error An exception was throw by _MapStream<User?, UserObject?> listened by”
I was following TheNetNinja's tutorial on YouTube : ( [this video] ), When I try to sign out, It gives the exception: An exception was throw by _MapStream<User?, UserObject?> listened by StreamProvider<UserObject?>, but no catchError was provided. I've read all the solutions on the net, but couldn't find one that fits. Since the video is from Oct 2019, I had to upgrade some parts of the code. I'll be very grateful If someone helps... Here's AuthService class: final FirebaseAuth _auth = FirebaseAuth.instance; //create user obj based on Firebase user UserObject? _userObjectFromFirebaseUser(User user) { return user != null ? UserObject(uid: user.uid) : null; } //auth change user stream Stream<UserOb