DEV Community

Discussion on: Flutter Web: Firestore CRUD

Collapse
 
emailsubjekt profile image
emailsubjekt

Hi, this doesn't work in deploy mode. It works only in test mode, when testing in Android Studio. When you deploy the app to the web so it has a URL everyone can see, all you get is a blank webpage with nothing on it. Please advise how to fix that.

Collapse
 
vewapps profile image
VEWapps

Does it work if you initialize the app in the index.html file instead of the main.dart file? That fixed a similar problem for me in a different app.

Collapse
 
happyharis profile image
happyharis

When you say initialise, you mean you are on debug mode? I'm not too sure about it, but if you want to debug, it will be tedious process.

Thread Thread
 
vewapps profile image
VEWapps

I may have used the wrong words. What I meant was to put:

var firebaseConfig = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""

};

firebase.initializeApp(firebaseConfig);
firebase.analytics();

in the index.html file instead of putting:

Future main() async {
if (Firebase.apps.isEmpty) {
print(Firebase.apps);
Firebase.initializeApp(
apiKey: '',
authDomain: '',
databaseURL: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
appId: '',
);
}

in the main.dart file.

Thread Thread
 
vewapps profile image
VEWapps

You know what though? It is working fine for me with the app config stuff in the main.dart file, so I doubt that what I suggested will fix your problem, but maybe you (emailsubjekt) will stumble across it if you keep trying.

Thread Thread
 
happyharis profile image
happyharis

Thanks for helping out VEWapps 😊

Collapse
 
happyharis profile image
happyharis

Try inspecting your website and see what's the error. To inspect: right click on the white screen and click inspect. Then go to the tab console and see the error. Don't reply this thread with your errors. If you can't fix the error, go to flutter github issue and create a new issue with your error.