iamshaunjp/flutter-firebase

Anon LogOut issue, Lesson #9

Opened this issue · 0 comments

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(),