- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在遇到可怕的问题后,我通过将我的项目传递给另一个项目来完成。但是现在它在尝试运行我的程序后给了我这个错误。这是我以前从未见过的。而且,我没有编辑这些代码,因为它们是库。
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_neumorphic-3.0.3/lib/src/widget/app_bar.dart:147:57: Error: No named parameter with the name 'nullOk'.
final ScaffoldState scaffold = Scaffold.of(context, nullOk: true);
^^^^^^
../../Developer/flutter/packages/flutter/lib/src/material/scaffold.dart:1918:24: Context: Found this candidate, but the arguments don't match.
static ScaffoldState of(BuildContext context) {
^^
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.4.0/lib/src/components/app_bar.dart:32:57: Error: No named parameter with the name 'nullOk'.
final ScaffoldState scaffold = Scaffold.of(context, nullOk: true);
^^^^^^
../../Developer/flutter/packages/flutter/lib/src/material/scaffold.dart:1918:24: Context: Found this candidate, but the arguments don't match.
static ScaffoldState of(BuildContext context) {
^^
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.4.0/lib/src/components/text_field.dart:953:32: Error: No named parameter with the name 'nullOk'.
MediaQuery.of(context, nullOk: true)?.navigationMode ??
^^^^^^
../../Developer/flutter/packages/flutter/lib/src/widgets/media_query.dart:818:25: Context: Found this candidate, but the arguments don't match.
static MediaQueryData of(BuildContext context) {
^^
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.4.0/lib/src/neumorphic/theme.dart:390:52: Error: No named parameter with the name 'nullOk'.
_cupertinoOverrideTheme.resolveFrom(context, nullOk: nullOk),
^^^^^^
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_neumorphic-3.0.3/lib/src/widget/app_bar.dart:147:57: Error: No named parameter with the name 'nullOk'.
final ScaffoldState scaffold = Scaffold.of(context, nullOk: true);
^^^^^^
../../Developer/flutter/packages/flutter/lib/src/material/scaffold.dart:1918:24: Context: Found this candidate, but the arguments don't match.
static ScaffoldState of(BuildContext context) {
^^
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.4.0/lib/src/components/app_bar.dart:32:57: Error: No named parameter with the name 'nullOk'.
final ScaffoldState scaffold = Scaffold.of(context, nullOk: true);
^^^^^^
../../Developer/flutter/packages/flutter/lib/src/material/scaffold.dart:1918:24: Context: Found this candidate, but the arguments don't match.
static ScaffoldState of(BuildContext context) {
^^
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.4.0/lib/src/components/text_field.dart:953:32: Error: No named parameter with the name 'nullOk'.
MediaQuery.of(context, nullOk: true)?.navigationMode ??
^^^^^^
../../Developer/flutter/packages/flutter/lib/src/widgets/media_query.dart:818:25: Context: Found this candidate, but the arguments don't match.
static MediaQueryData of(BuildContext context) {
^^
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/neumorphic-0.4.0/lib/src/neumorphic/theme.dart:390:52: Error: No named parameter with the name 'nullOk'.
_cupertinoOverrideTheme.resolveFrom(context, nullOk: nullOk),
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
^^^^^^
这是我的 pubspec.yaml
name: Test
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
rflutter_alert: ^1.0.3
flutter:
sdk: flutter
mqtt_client: ^8.0.0
provider: ^4.3.2+2
get_it: ^5.0.1
vibration: ^1.7.2
clay_containers: ^0.2.2
local_auth: ^0.6.2+1
flutter_secure_storage: ^3.3.3
neumorphic: ^0.4.0
shared_preferences: ^0.5.8
flutter_neumorphic: ^3.0.3
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
assets:
- images/homestadelogo.png
- images/morning.png
fonts:
- family: OpenSans
fonts:
- asset: fonts/assets/fonts/OpenSans.ttf
- family: myLamp
fonts:
- asset: fonts/assets/fonts/mylamp.ttf
我该怎么办?
最佳答案
几个nullOk
作为空安全迁移后的一部分,参数已被删除。您可以在 corresponding design doc 上阅读更多信息及其即将推出的 migration guide .
TL;DR 你可以尝试使用 .maybeOf(context)
而不是 .of(context, nullOk: true);
您可能必须更新您的依赖项才能使其正常工作。
关于flutter - flutter 中没有名称为 'nullOk' 的命名参数错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64791065/
这个问题在这里已经有了答案: How to fix this nullOk error when using the flutter_svg package? (7 个回答) 7 个月前关闭。 当我尝
在遇到可怕的问题后,我通过将我的项目传递给另一个项目来完成。但是现在它在尝试运行我的程序后给了我这个错误。这是我以前从未见过的。而且,我没有编辑这些代码,因为它们是库。 ../../Developer
我连接了包,将它添加到 main.dart,我尝试编译应用程序,但出现此错误。帮助!我该怎么办? 错误 Launching lib\main.dart on XT1562 in debug mode.
我将我的应用程序更新到最新版本的 Flutter。E:\anmol\Jan' 2021 -Backup\nemar_user_(for_new_packages)>flutter --versionF
我是一名优秀的程序员,十分优秀!