onStartupTask method

  1. @override
Future<void> onStartupTask()
override

Implementation

@override
Future<void> onStartupTask() async {
  FirebaseAuth.instance
      .authStateChanges()
      .map(_AuthState.of)
      .distinct()
      .asyncMap(_onAuthState)
      .listen((_) {});

  if (allowAnonymous) {
    await FirebaseAuth.instance.signInAnonymously();
  }
}