我正在尝试在 Flutter 集成电子邮件和基于 google 的登录中尝试一个示例项目,并计划使用 firebase 初始化来执行此操作,同时我已按照教程中提到的所有步骤进行操作,一旦尝试使用 firebase,我就会收到此错误已初始化。
"FirebaseOptions cannot be null when creating the default app."
at Object.throw_ [as throw] (http://localhost:7357/dart_sdk.js:5063:11)
at Object.assertFailed (http://localhost:7357/dart_sdk.js:4988:15)
at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:7357/packages/firebase_core_web/firebase_core_web.dart.lib.js:252:42)
at initializeApp.next (<anonymous>)
at http://localhost:7357/dart_sdk.js:40192:33
at _RootZone.runUnary (http://localhost:7357/dart_sdk.js:40062:59)
at _FutureListener.thenAwait.handleValue (http://localhost:7357/dart_sdk.js:34983:29)
at handleValueCallback (http://localhost:7357/dart_sdk.js:35551:49)
at Function._propagateToListeners (http://localhost:7357/dart_sdk.js:35589:17)
at _Future.new.[_completeWithValue] (http://localhost:7357/dart_sdk.js:35437:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:7357/dart_sdk.js:35458:35)
at Object._microtaskLoop (http://localhost:7357/dart_sdk.js:40330:13)
at _startMicrotaskLoop (http://localhost:7357/dart_sdk.js:40336:13)
at http://localhost:7357/dart_sdk.js:35811:9
Run Code Online (Sandbox Code Playgroud)
这是我的index.html
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的应用程序中实现 Flutter Web url 导航。当我尝试直接打开 http://localhost:7357/privacy-policy 时,它在我的本地计算机上打开正常,但是当我在服务器上部署后尝试直接打开相同的 URL 时,它不会加载并抛出错误。
我正在使用 Firebase 来部署我的应用程序。
部署后,当我尝试通过主页访问而没有任何特定导航(例如www.example.com )时,一切正常,当我尝试直接访问页面www.example.com/privacy-policy时,就会出现错误浏览主页。
非常感谢任何帮助。谢谢。