backbone
backbone copied to clipboard
Exception on input handling
Holla :)
I get an exception when I release the mouse button outside the screen area.
Video
https://user-images.githubusercontent.com/56475207/218053265-893c0b2a-766c-4907-8911-a90b7519b8ba.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: https://github.com/sturdykeep/backbone/blob/c3ecf08c43dc03f4c0518e61a5ccb2eefc9825fa/lib/prelude/input/mod.dart#L117
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 :)
Oops, didn't noticeπ
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.
@Dan-Crane, can you check if the latest merges into main fixed your issue?
@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!