flutter_pinput:FocusTapArea 未定义

Rud*_*kur 5 flutter flutter-dependencies flutter-packages flutter-pub

升级到 Flutter 3.1.x 后,该包flutter_pinput不再工作。任何的意见都将会有帮助。它在 flutter 2.xx 中工作正常,我尝试使用修复缓存flutter pub cache repair,并使用清理项目缓存flutter clean。它仍然不起作用。

\n
 /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'.\n         - '_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').\n        Try correcting the name to the name of an existing method, or defining a method named 'FocusTrapArea'.\n              child: FocusTrapArea(\n                     ^^^^^^^^^^^^^\n        \n        \n        FAILURE: Build failed with an exception.\n        \n        * Where:\n        Script 'D:\\flutter\\packages\\flutter_tools\\gradle\\flutter.gradle' line: 1159\n        \n        * What went wrong:\n        Execution failed for task ':app:compileFlutterBuildDebug'.\n        > Process 'command 'D:\\flutter\\bin\\flutter.bat'' finished with non-zero exit value 1\n        \n        * Try:\n        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. \n        Run with --scan to get full insights.\n        \n        * Get more help at https://help.gradle.org\n        \n        BUILD FAILED in 27s\n        Running Gradle task 'assembleDebug'...                             29.0s\n        Exception: Gradle task assembleDebug failed with exit code 1\n
Run Code Online (Sandbox Code Playgroud)\n

版本信息:

\n
Flutter 3.1.0-0.0.pre.2085 \xe2\x80\xa2 channel master \xe2\x80\xa2 https://github.com/flutter/flutter.git\nFramework \xe2\x80\xa2 revision 74aef9ff87 (8 hours ago) \xe2\x80\xa2 2022-08-04 02:00:08 -0400\nEngine \xe2\x80\xa2 revision e32e0d217b\nTools \xe2\x80\xa2 Dart 2.19.0 (build 2.19.0-62.0.dev) \xe2\x80\xa2 DevTools 2.16.0\n
Run Code Online (Sandbox Code Playgroud)\n

小智 0

以便切换到稳定通道。

flutter channel stable && flutter upgrade