If you have stumbled upon this error: “FirebaseOptions cannot be null when creating the default app”. From what I can tell I see that there can be a few different issues.
One of them is that you are using a lower version of Flutter which have the requirement of the function of Firebase.initializeApp() to pass the options into the initializeApp function which you’ve simply forgot.
Another issue is that you have placed the google-services.json file in the wrong directory. It should be inside the android app folder, like so android\app. Could also be an issue of not adding dependency google services to build.gradle (both in android/app folder and in android folder) like shown at the tutorial here.
Third one, and it’s specifically for flutter web, that is to say, I got the error and the only solution for the error to disappear and it would work as expected was to replace the index.html file contents with the example from a stackoverflow post here. See similar code below from my index.html file: