[英]Why firebase not working with flutter web?
when I don't initialize当我不初始化时
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
it chrome shows the UI, but when I add it displays nothing.它 chrome 显示用户界面,但是当我添加时它什么都不显示。 How can I solve this error chrome output , code warning
如何解决此错误chrome output ,代码警告
So aparently when you are debugging it in web mode, you need to pass this option in the initializer function-所以很明显,当你在 web 模式下调试它时,你需要在初始化函数中传递这个选项 -
await Firebase.initializeApp(
options: FirebaseOptions(
apiKey: "",
appId: "",
messagingSenderId: "",
projectId: ""),
);
You also have to initialize Firebase in index.html;您还必须在 index.html 中初始化 Firebase; here is the documentation .
这是文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.