我尝试实现一个应用程序。我运行了好几次都没有出错。但没有任何原因,在我尝试运行应用程序一天后,我出现了以下错误,我试图找到id的解决方案,但一无所获。
那么,有人能告诉我如何解决它吗?
Launching libmain.dart on sdk gphone x86 in debug mode...
libmain.dart
../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/retry-3.0.1/lib/retry.dart:131:16: Error: Expected ';' after this.
return Pestawait fn();
^^^^^^^^^
../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/retry-3.0.1/lib/retry.dart:131:16: Error: The getter 'Pestawait' isn't defined for the class 'RetryOptions'.
- 'RetryOptions' is from 'package:retry/retry.dart' ('../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/retry-3.0.1/lib/retry.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Pestawait'.
return Pestawait fn();
^^^^^^^^^
../../../flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.4.0/lib/flutter_datetime_picker.dart:215:48: Error: No named parameter with the name 'shadowThemeOnly'.
ThemeData inheritTheme = Theme.of(context, shadowThemeOnly: true);
^^^^^^^^^^^^^^^
../../../flutter/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
FAILURE: Build failed with an exception.
* Where:
Script 'D:mohyflutterflutterpackagesflutter_toolsgradleflutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:mohyflutterflutterbinflutter.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 9m 1s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
你的库好像坏了。您可以删除该文件夹,然后重新安装该软件包。或者,为了快速修复,您可以在相关文件中更改该零件,如下所示。
Future<T> retry<T>(
FutureOr<T> Function() fn, {
FutureOr<bool> Function(Exception)? retryIf,
FutureOr<void> Function(Exception)? onRetry,
}) async {
var attempt = 0;
// ignore: literal_only_boolean_expressions
while (true) {
attempt++; // first invocation is the first attempt
try {
return await fn(); // Here is broken!
} on Exception catch (e) {
if (attempt >= maxAttempts ||
(retryIf != null && !(await retryIf(e)))) {
rethrow;
}
if (onRetry != null) {
await onRetry(e);
}
}
// Sleep for a delay
await Future.delayed(delay(attempt));
}
}
}