To Solve this type of error in flutter , Just add “name” in Firebase.initializeApp(name : “MyApp”).
For example: –
Just change
await Firebase.initializeApp( // Replace with actual values options: const FirebaseOptions( apiKey: "<your apiKey>", appId: "<your appId>", messagingSenderId: "<messagingSenderId>", projectId: "<project-id>", ), )
To
await Firebase.initializeApp( name: "MyApp", // Replace with actual values options: const FirebaseOptions( apiKey: "<your apiKey>", appId: "<your appId>", messagingSenderId: "<messagingSenderId>", projectId: "<project-id>", ), )