I have tried repairing the cache using flutter pub cache repairand also cleaned the project cache using flutter clean.It still doesn’t work.
/C:/Users/Phili/AppData/Local/Pub/Cache/hosted/pub.dev/pinput-2.2.20/lib/src/pinput_state.dart:339:14: Error: The method ‘FocusTrapArea’ isn’t defined for the class ‘_PinputState’.
- ‘_PinputState’ is from ‘package:pinput/src/pinput.dart’ (‘/C:/Users/Phili/AppData/Local/Pub/Cache/hosted/pub.dev/pinput-2.2.20/lib/src/pinput.dart’).
Try correcting the name to the name of an existing method, or defining a method named ‘FocusTrapArea’.
child: FocusTrapArea(
^^^^^^^^^^^^^
Failed to compile application.
anyone answer please
3
Answers
sorry this is coming late! I experienced mine when I updated my Flutter version to 3.7 so what I did was to update the Piput package version to the latest version and that solved mine for me. I hope it helps. I could not fully figure out what happen why it broke my app the first time but it was intuitive for me to upgrade the pinput package.
I had the same issue when I cloned a flutter open source project from Github.
I resolved it by upgrading the
pinput
package to its latest version.At the time of writing this answer, the latest
pinput
version is2.2.31
.Follow these steps:
pubspec.yaml
file, change thepinput
to the latest version.flutter clean
flutter run
, it will internally call flutter pub get for you.what worked for me is to delete my pubspec.lock then running
flutter clean
command. hope it’ll work for you