This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Description
There is a bug when using drag and drop together with the expand/collapse node feature that crashes the app if an item is dragged far from its original spot so that the childWhenDragging widget is outside viewport (to the point where it gets disposed by flutter).
In this situation, if the dragged item is hovered over another node and expands that node, an error is thrown and scrolling gets freezed. However if all nodes are already expanded everything works fine even if the item is dragged very far from its original place.
Steps to reproduce this bug:
- Run the example app on web
- Switch to Drag and Drop example
- Expand all first-leve nodes 0, 14, 22, 29, 38, 53
- Make the window size smaller in height (so that scrolling is required)
- Expand node 57
- Drag the last node 61 to the top and hover it over node 1 to expand it
The following errors will appear in console and everything will stop working:
Assertion failed: file:///C:/Flutter/flutter/packages/flutter/lib/src/rendering/mouse_tracker.dart:203:12
!_debugDuringDeviceUpdate
is not true
and
Duplicate GlobalKeys detected in widget tree.
I am on flutter 3.29.2.