iamshaunjp / flutter-firebase

All course files for the Flutter & Firebase tutorial playlist on The Net Ninja YouTube channel
578 stars 440 forks source link

Anon LogOut issue, Lesson #9 #11

Open TatuSaa opened 4 years ago

TatuSaa commented 4 years ago

While pushing logout you are actually logged out from Firebase but it won't return to authentication screen.

Error: Exception caught by provider The following assertion was thrown: An exception was throw by _MapStream<FirebaseUser, User> listened by

StreamProvider, but no catchError was provided.

Exception: NoSuchMethodError: The getter 'uid' was called on null. Receiver: null Tried calling: uid

FIX: @override Widget build(BuildContext context) { return StreamProvider.value( catchError: (_, __) => null, //add above to main.dart value: AuthService().user, child: MaterialApp( home: Wrapper(),