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

Exception on input handling #68

Open
Dan-Crane opened this issue Feb 10, 2023 · 5 comments
Open

Exception on input handling #68

Dan-Crane opened this issue Feb 10, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Dan-Crane
Copy link

Holla :)

I get an exception when I release the mouse button outside the screen area.

Video
exception_2.mov
Logs:
Restarted application in 208ms.

════════ Exception caught by gesture library ═══════════════════════════════════
The following StateError was thrown while routing a pointer event:
Bad state: No element

When the exception was thrown, this was the stack
#0      ListMixin.firstWhere (dart:collection/list.dart:167:5)
#1      Input.onPointerRemoved
#2      _BackboneGameWidgetState._handleEvent
#3      PointerRouter._dispatch
#4      PointerRouter._dispatchEventToRoutes.<anonymous closure>
#5      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
#6      PointerRouter._dispatchEventToRoutes
#7      PointerRouter.route
#8      GestureBinding.dispatchEvent
#9      RendererBinding.dispatchEvent
#10     GestureBinding._handlePointerEventImmediately
#11     GestureBinding.handlePointerEvent
#12     GestureBinding._flushPointerEventQueue
#13     GestureBinding._handlePointerDataPacket
#14     _invoke1 (dart:ui/hooks.dart:164:13)
#15     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:361:7)
#16     _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)
════════════════════════════════════════════════════════════════════════════════

Stacktrace leads to this place:

final leavingPointer = _pointers.firstWhere((pointer) =>

@Dev-Owl
Copy link
Collaborator

Dev-Owl commented Feb 10, 2023

Hi @Dan-Crane thanks for reporting I guess you run into #35 , there are some special cases for input handling on different platforms.
We will handle this more gracefully, there is also an issue in Flutter that some platforms don't send in events to cancel some states like hover.

If you have a suggestion on how to improve don't hesitate to get in touch :)

@Dev-Owl Dev-Owl added the bug Something isn't working label Feb 10, 2023
@Dan-Crane
Copy link
Author

Oops, didn't notice🙈

@Dev-Owl
Copy link
Collaborator

Dev-Owl commented Feb 10, 2023

No worries, we are currently working on adding further default traits/system to backbone, if you checkout the "Dash Tennis" project you can see that it has traits & systems for sprite and text handling.

The plan is to introduce systems that can also directly render, so people can but don't have to use a sprite component just for drawing.

@skyne98
Copy link
Contributor

skyne98 commented Feb 16, 2023

@Dan-Crane, can you check if the latest merges into main fixed your issue?

@Dan-Crane
Copy link
Author

@skyne98, no, the problem is still there.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.1 22C65 darwin-arm64, locale en-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.75.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants