Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: FocusTrapArea isn't defined for the class '_PinputState'. #98

Closed
zhangwen0510 opened this issue Jul 31, 2022 · 20 comments
Closed

Comments

@zhangwen0510
Copy link

pub.flutter-io.cn/pinput-2.2.11/lib/src/pinput_state.dart:334:14: Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.

@zhangwen0510
Copy link
Author

Flutter 3.1.0-0.0.pre.2002 • channel master • https://github.com/flutter/flutter.git
Framework • revision 5535b48e94 (24 minutes ago) • 2022-07-30 20:25:05 -0400
Engine • revision 0093991aa1
Tools • Dart 2.19.0 (build 2.19.0-47.0.dev) • DevTools 2.16.0

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.1.0-0.0.pre.2002, on macOS 12.1 21C52 darwin-x64, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

@Tkko
Copy link
Owner

Tkko commented Jul 31, 2022

Looks like the issue is related to master channel, could you try if it's working on stable?

@shenzhen-arrom
Copy link

pub.flutter-io.cn/pinput-2.2.11/lib/src/pinput_state.dart:334:14: Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.

你切换到稳定版本就好,3.0.5这个版本中是有FocusTrapArea这个组件的,希望对你有帮助

@zeevgrim
Copy link

any update on the issue

@Tkko
Copy link
Owner

Tkko commented Aug 11, 2022

any update on the issue

Are you using Stable Flutter channel?

@Tkko
Copy link
Owner

Tkko commented Aug 11, 2022

By this PR FocusTrapArea was replaced with TapRegion on master branch of the Flutter repository, and I'll replace it as well after merging it to stable branch.

Here is the patch and you can directly depend on it if you are using Flutter master channel

  pinput:
   git:
    url: https://github.com/Tkko/Flutter_Pinput
    ref: dev 

@ShwetaChauhan18
Copy link

any update on this issue??

@Tkko
Copy link
Owner

Tkko commented Aug 12, 2022

any update on this issue??

#98 (comment)

@rezadevelopers2
Copy link

Is this problem solved?

@Tkko
Copy link
Owner

Tkko commented Sep 3, 2022

Is this problem solved?

#98 (comment)

@rezadevelopers2
Copy link

any update on this issue??

#98 (comment)

this error

/C:/Users/REZA/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/pinput-2.2.12/lib/src/pinput_state.dart:337:14: Error: The method 'FocusTrapArea' isn't defined for the class '_PinputState'.

  • '_PinputState' is from 'package:pinput/src/pinput.dart' ('/C:/Users/REZA/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/pinput-2.2.12/lib/src/pinput.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'FocusTrapArea'.
    child: FocusTrapArea(
    ^^^^^^^^^^^^^

[√] Flutter (Channel master, 3.4.0-19.0.pre.58, on Microsoft Windows [Version 10.0.19044.1889], locale en-US)
• Flutter version 3.4.0-19.0.pre.58 on channel master at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 3014d57368 (15 hours ago), 2022-09-02 22:38:54 -0400
• Engine revision feb1729235
• Dart version 2.19.0 (build 2.19.0-159.0.dev)
• DevTools version 2.16.0

@Tkko
Copy link
Owner

Tkko commented Sep 3, 2022

Is this problem solved?

Switch to stable channel or use

  pinput:
   git:
    url: https://github.com/Tkko/Flutter_Pinput
    ref: dev 

@rezadevelopers2
Copy link

Is this problem solved?

Switch to stable channel or use

  pinput:
   git:
    url: https://github.com/Tkko/Flutter_Pinput
    ref: dev 

Thankful

@Messhias
Copy link

Messhias commented Oct 4, 2022

Is this problem solved?

Switch to stable channel or use

  pinput:
   git:
    url: https://github.com/Tkko/Flutter_Pinput
    ref: dev 

Still the same issue and I'm in stable channel:
image

@Tkko
Copy link
Owner

Tkko commented Oct 4, 2022

Is this problem solved?

Switch to stable channel or use

pinput:

git:

url: https://github.com/Tkko/Flutter_Pinput
ref: dev 

Still the same issue and I'm in stable channel:

image

Flutter version?

@Messhias
Copy link

Messhias commented Oct 4, 2022

Is this problem solved?

Switch to stable channel or use

pinput:

git:

url: https://github.com/Tkko/Flutter_Pinput
ref: dev 

Still the same issue and I'm in a stable channel:
image

Flutter version?

Don't worry anymore, I found another package that works fine with the newest version (3.0.5).

@Tkko
Copy link
Owner

Tkko commented Oct 4, 2022

@Messhias good luck with using another package, and for the record pinput works fine with every stable version > 2.0.0

By this PR FocusTrapArea was replaced with TapRegion on master branch of the Flutter repository, and I'll replace it as well after merging it to stable branch.

Here is the patch and you can directly depend on it if you are using Flutter master channel

  pinput:
   git:
    url: https://github.com/Tkko/Flutter_Pinput
    ref: dev 

@Messhias
Copy link

Messhias commented Oct 11, 2022 via email

@Tkko
Copy link
Owner

Tkko commented Oct 11, 2022

As you can see FocusTrapArea is used inside the TextField on the stable channel, that being said if you are using the Flutter's stable channel Pinput should work as well

https://github.com/flutter/flutter/blob/eb6d86ee27deecba4a83536aa20f366a6044895c/packages/flutter/lib/src/material/text_field.dart#L1323

@cedvdb
Copy link

cedvdb commented Nov 7, 2022

People are quick to complain, this did not even reach stable on the flutter channel. You have the patience of a saint.

Anyway, please update here if you don't mind when this reach pub.dev, so we don't forget to change the hardcoded dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants