gpt4 book ai didi

flutter - 如何更新 flutterfire_web_sdk_version 以及如何启用 'non-nullable' 语言功能

转载 作者:行者123 更新时间:2023-12-05 04:28:57 27 4
gpt4 key购买 nike

当我运行我的代码时,我收到了这个警告:

Flutter Web Bootstrap: Programmatic
WARNING: FlutterFire for Web is explicitly tested against Firebase JS SDK version "8.10.1"
but you are currently specifying "8.6.1" by either the imported Firebase JS SDKs in your web/index.html
file or by providing an override - this may lead to unexpected issues in your application. It is recommended that you change all of the versions of the
Firebase JS SDK version "8.10.1":

If you override the version manually:
change:
<script>window.flutterfire_web_sdk_version = '8.6.1';</script>
to:
<script>window.flutterfire_web_sdk_version = '8.10.1';</script>

If you import the Firebase scripts in index.html, instead allow FlutterFire to manage this for you by removing
any Firebase scripts in your web/index.html file:
e.g. remove: <script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js"></script>

我已经尝试找到 the <script>window.flutterfire_web_sdk_version = '8.6.1';</script>在索引文件中,但我找不到它。因此我无法升级它。

有人知道如何解决这个警告吗?

第二个问题:

当我想使用 non-nullable 时,我得到这个错误:

This requires the 'non-nullable' language feature to be enabled.

我正在使用 sdk: '>=2.6.0 <3.0.0'所以它实际上应该被启用。有人知道为什么它不工作/不启用吗?

我正在使用的包是(也许这对你有帮助):

cupertino_icons: ^1.0.2
responsive_builder: ^0.4.2
get_it: ^7.2.0
provider: ^4.1.1
provider_architecture: ^1.1.1+1
firebase_auth: ^3.3.19
firebase_core: ^1.17.1
cloud_firestore: ^3.1.13

我已经尝试过 clean flutter并使用 Pug get再次。

最佳答案

第二个问题:

为了空安全,你需要使用 sdk: '>=2.12.0 <3.0.0' . Here您可以找到如何启用空安全。

关于flutter - 如何更新 flutterfire_web_sdk_version 以及如何启用 'non-nullable' 语言功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72461737/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com