为什么在使用库(dmrtd)中的“示例”时会出现这些错误?

问题描述 投票:0回答:1
Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
../../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-3.3.5/lib/src/platform_text_field.dart:578:30: Error: The argument type 'bool?' can't be assigned to the parameter type 'bool' because 'bool?' is nullable and 'bool' isn't.
      enabled: data?.enabled ?? enabled,
                             ^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1419

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Error: Gradle task assembleDebug failed with exit code 1

我尝试修复这些错误但失败了。你能帮我吗?

flutter dart nfc nfc-p2p
1个回答
0
投票

您试图将可空的

bool
(即
data?.enabled
)传递给您的语句,这是不可接受的。您可以做的就是使
date
不可为空,或者在将其传递给语句之前检查它是否不为空。

© www.soinside.com 2019 - 2024. All rights reserved.