Muezz
04/23/2022, 3:18 PMUser):
dart
Stream<User?> get authChangeStream => _firebaseAuth.authStateChanges();
How can I recreate a similar functionality with Supabase? Currently, I have this:
dart
Stream<User?> get authChangeStream {
return _authService.onAuthStateChange((event, session) => session!.user);
}
I am getting the following error:
A value of type 'GotrueSubscription' can't be returned from the function 'authChangeStream' because it has a return type of 'Stream<User?>'
What should I do to get a Stream here?Vinzent
04/23/2022, 3:52 PMStreamController() and add events to that controller and return the stream from the controller via controller.stream.Muezz
04/23/2022, 3:56 PMMuezz
04/23/2022, 3:58 PMsession.user from my previous message and _authInstance.currentUser?Vinzent
04/23/2022, 3:59 PMVinzent
04/23/2022, 4:00 PMVinzent
04/23/2022, 4:03 PMMuezz
04/23/2022, 4:03 PMMuezz
04/23/2022, 4:03 PMMuezz
04/23/2022, 4:04 PMgotrue is lmaoVinzent
04/23/2022, 4:06 PMMuezz
04/23/2022, 4:09 PMMuezz
04/23/2022, 4:10 PMVinzent
04/23/2022, 4:11 PMMuezz
04/23/2022, 4:12 PMMuezz
04/23/2022, 4:12 PM