Complete the code to initialize Firebase in a Flutter app.
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase[1]();
runApp(MyApp());
}The correct method to initialize Firebase in Flutter is initializeApp().
Complete the code to get an instance of Firestore in Flutter.
final FirebaseFirestore firestore = FirebaseFirestore.[1];The correct way to get Firestore instance is using the instance getter.
Fix the error in the code to add a document to Firestore collection.
await firestore.collection('users').[1]({'name': 'Alice', 'age': 25});
The correct method to add a document to a collection is add().
Fill both blanks to read a document from Firestore and print its data.
DocumentSnapshot snapshot = await firestore.collection('users').[1]('user123').[2](); print(snapshot.data());
Use doc() to specify the document and get() to fetch it.
Fill all three blanks to update a Firestore document with new data.
await firestore.collection('users').[1]('user123').[2]([3]);
Use doc() to select the document, update() to modify it, and pass the new data as a map.
