skip to Main Content

Correct way to init firebase in flutter

I am trying to initialize Firebase in flutter project. I use FutureBuilder to load this function: static Future initializeFirebase({required BuildContext context}) async { try { FirebaseApp firebaseApp = await Firebase.initializeApp( options: FirebaseOptions( apiKey: "abc", authDomain: "def", projectId: "ghi", storageBucket: "jkl",…

VIEW QUESTION

Getting error Firebase exception in flutter code about initialisation

Getting Firebase exception in flutter code about initialisation. I have already initialised it in main function. getting error on first line of code where fire store collection initialised. import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:xuriti/models/core/user_details.dart'; class UserInfoService{ CollectionReference userInfoCollection = FirebaseFirestore.instance.collection('userInfo'); UserDetails userDetails…

VIEW QUESTION
Back To Top
Search