initializeApp static method

Future<void> initializeApp({
  1. String? name,
  2. required FirebaseOptions options,
  3. required bool firestore,
  4. required bool auth,
  5. required bool storage,
})

Implementation

static Future<void> initializeApp({
  String? name,
  required FirebaseOptions options,
  required bool firestore,
  required bool auth,
  required bool storage,
  //required bool functions,
}) async {
  FirebaseControlPanel panel = Get.put(FirebaseControlPanel(
    firestore: firestore,
    storage: storage,
  ));
  panel.setOptions = options;
  panel.setName = name;
  if (isValid() || (!isValid() && (auth /*|| functions*/))) {
    if (isDesktop()) {
      firebase_core_desktop.FirebaseCore.registerWith();
      firebase_auth_desktop.FirebaseAuthDesktop.registerWith();
    }
    await Firebase.initializeApp(
        name: Get.find<FirebaseControlPanel>().name,
        options: Get.find<FirebaseControlPanel>().options);
  }
  if (!isValid() && firestore) {
    await initFirestoreWindows();
  }
  if (!isValid() && storage) {
    await initStorageWindows();
  }
  if (auth) {
    Get.find<FirebaseControlPanel>().instanceAuth();
  }
  //if (functions) {
  //  Get.find<FirebaseControlPanel>().instanceFunctions();
  //}
}