Flutter_Pinput icon indicating copy to clipboard operation
Flutter_Pinput copied to clipboard

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

Open zhangwen0510 opened this issue 3 years ago • 13 comments

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 avatar Jul 31 '22 01:07 zhangwen0510

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

zhangwen0510 avatar Jul 31 '22 01:07 zhangwen0510

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

Tkko avatar Jul 31 '22 13:07 Tkko

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这个组件的,希望对你有帮助

shenzhen-arrom avatar Aug 11 '22 06:08 shenzhen-arrom

any update on the issue

zeevgrim avatar Aug 11 '22 16:08 zeevgrim

any update on the issue

Are you using Stable Flutter channel?

Tkko avatar Aug 11 '22 16:08 Tkko

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 

Tkko avatar Aug 11 '22 17:08 Tkko

any update on this issue??

ShwetaChauhan18 avatar Aug 12 '22 04:08 ShwetaChauhan18

any update on this issue??

https://github.com/Tkko/Flutter_Pinput/issues/98#issuecomment-1212291722

Tkko avatar Aug 12 '22 05:08 Tkko

Is this problem solved?

rezadevelopers2 avatar Sep 03 '22 17:09 rezadevelopers2

Is this problem solved?

https://github.com/Tkko/Flutter_Pinput/issues/98#issuecomment-1212291722

Tkko avatar Sep 03 '22 17:09 Tkko

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

rezadevelopers2 avatar Sep 03 '22 17:09 rezadevelopers2

Is this problem solved?

Switch to stable channel or use

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

Tkko avatar Sep 03 '22 17:09 Tkko

Is this problem solved?

Switch to stable channel or use

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

Thankful

rezadevelopers2 avatar Sep 03 '22 17:09 rezadevelopers2

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

Messhias avatar Oct 04 '22 11:10 Messhias

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?

Tkko avatar Oct 04 '22 12:10 Tkko

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).

Messhias avatar Oct 04 '22 13:10 Messhias

@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 

Tkko avatar Oct 04 '22 13:10 Tkko

It doesn't, I already tried to do that, and didn't work out.

Thanks anyway the other package works well for me.

Em ter., 4 de out. de 2022 às 14:22, Tornike @.***> escreveu:

@Messhias https://github.com/Messhias good luck with using another package, and for the record pinput works fine with every stable version > 2.0.0

By this PR https://github.com/flutter/flutter/pull/107262 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

— Reply to this email directly, view it on GitHub https://github.com/Tkko/Flutter_Pinput/issues/98#issuecomment-1266989855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3QQ7A5PBCELBALB4RRL3WBQVPVANCNFSM55ECCR2A . You are receiving this because you were mentioned.Message ID: @.***>

Messhias avatar Oct 11 '22 08:10 Messhias

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

Tkko avatar Oct 11 '22 08:10 Tkko

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

cedvdb avatar Nov 07 '22 11:11 cedvdb