升级到Flutter 3.1.x后,包flutter_pinput
不再工作。任何建议都会很有帮助。它在flutter 2.x.x中运行良好。我尝试过使用flutter pub cache repair
修复缓存,也使用flutter clean
清理项目缓存。它仍然不起作用。
/C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/pinput-2.2.11/lib/src/pinput_state.dart:334:14: Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.
- '_PinputState' is from 'package:pinput/src/pinput.dart' ('/C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/pinput-2.2.11/lib/src/pinput.dart').
Try correcting the name to the name of an existing method, or defining a method named 'FocusTrapArea'.
child: FocusTrapArea(
^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'D:flutterpackagesflutter_toolsgradleflutter.gradle' line: 1159
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:flutterbinflutter.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 27s
Running Gradle task 'assembleDebug'... 29.0s
Exception: Gradle task assembleDebug failed with exit code 1
版本信息:
Flutter 3.1.0-0.0.pre.2085 • channel master • https://github.com/flutter/flutter.git
Framework • revision 74aef9ff87 (8 hours ago) • 2022-08-04 02:00:08 -0400
Engine • revision e32e0d217b
Tools • Dart 2.19.0 (build 2.19.0-62.0.dev) • DevTools 2.16.0
为了切换到稳定通道。
flutter channel stable && flutter upgrade
更新您的包pinput
更新程序包后,请再次运行您的应用程序。