0
votes

In main.dart I've added this:

FirebaseAuth.instance.userChanges().listen((event) async {
      debugPrint('user state changed in main');
    });

The event is continuously getting triggered, with no changes to the users logged in status (I am developing for the web, not tested on devices).

1

1 Answers

0
votes

Use authStateChanges when interested in the current user.

authStateChanges

Notifies about changes to the user's sign-in state (such as sign-in or sign-out).

userChanges

Notifies about changes to any user updates.