graph-cn / flutter_graph_view

An open source project which can display beautiful graph data structure, such as force-directed.
https://graph-cn.github.io/flutter_graph_view/
Apache License 2.0
51 stars 12 forks source link

Error onHover item after hot reload/restart in example app #6

Closed muknta closed 7 months ago

muknta commented 7 months ago

Platform: Macos 14.3.1

======== Exception caught by gesture library =======================================================
The following assertion was thrown while dispatching a pointer event:
Trying to add an unknown overlay "vertex"
'package:flame/src/game/overlay_manager.dart':
Failed assertion: line 51 pos 7: '_builders.containsKey(name)'

When the exception was thrown, this was the stack: 
#2      OverlayManager._addImpl (package:flame/src/game/overlay_manager.dart:51:7)
#3      OverlayManager.add (package:flame/src/game/overlay_manager.dart:33:24)
#4      VertexComponent.onHoverEnter (package:flutter_graph_view/widgets/vertex_component.dart:104:22)
#5      HoverCallbacks._doHoverEnter (package:flame/src/events/component_mixins/hover_callbacks.dart:26:5)
#6      HoverCallbacks.onPointerMove (package:flame/src/events/component_mixins/hover_callbacks.dart:39:9)
#7      PointerMoveDispatcher.onMouseMove.<anonymous closure> (package:flame/src/events/flame_game_mixins/pointer_move_dispatcher.dart:31:19)
#8      LocationContextEvent.deliverAtPoint (package:flame/src/events/messages/location_context_event.dart:43:19)
#9      PointerMoveDispatcher.onMouseMove (package:flame/src/events/flame_game_mixins/pointer_move_dispatcher.dart:24:11)
CorvusYe commented 7 months ago

@muknta Thanks for your report. I had fix this bug already. https://github.com/graph-cn/flutter_graph_view/commit/b0eb074ce2538b870950fc219b6377d194ba378d