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



当我运行我的代码,然后我得到这个警告:

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

第二个问题:

对于null安全,您需要使用sdk: '>=2.12.0 <3.0.0'。在这里你可以找到如何启用null安全。

最新更新