initializeFirebase static method

Future<FirebaseApp> initializeFirebase({
  1. required BuildContext context,
})

Implementation

static Future<FirebaseApp> initializeFirebase({
  required BuildContext context,
}) async {
  FirebaseApp firebaseApp = await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

  User? user = FirebaseAuth.instance.currentUser;

  if (user != null) {
    Navigator.of(context).pushReplacement(
      MaterialPageRoute(
        builder: (context) => Navigation(pIndex: 0, eventsToLoad: "All"),
      ),
    );
  }

  return firebaseApp;
}