Implementation Details
• My GridView is built using a Stack, where a placed the upload/image containers in a 3 * 3 matrix.
• Instead of updating the UI through Firestore queries, I am updating it via PageState variables.
• I am not changing the actual container positions in the grid. Instead, I swap the Image Path between two PageStates, which dynamically updates the displayed images.
• So far, my logic only swaps two images, but I have not yet implemented any logic to shift other images forward, like in more advanced drag-and-drop interfaces (e.g., when dragging an item in iOS home screen-style apps).
• The issue persists in both simulator and real device testing.
Potential Cause?
I am wondering if the Drag-and-Drop functionality only works properly when using a ListView that dynamically generates items. Could it be that my Stack-based approach is causing the issue?
What I Have Tried
1. Ensuring that the Draggable widget properly wraps the uploaded image (also tried it out with Draggable widget wrapping a container that contains the image).
2. Checking if there is any opacity issue or visibility problem in the widget tree.
3. Running tests on both the simulator and a physical iPhone.
4. Verifying that the PageState updates correctly reflect the changes.
Attachments
• Screenshot of the Widget Tree around the Image widget.
• Screenshot of the UI when testing the drag functionality.
Question
What could be causing the Draggable widget to not display the dragged item visually? Could this be a limitation where Drag-and-Drop only works properly in a ListView or dynamically generated lists?
If this is not expected behavior, I would appreciate any suggestions on how to achieve the desired behavior.
Additionally, since I am only swapping Image Paths and not container positions, how could I implement a more dynamic shifting mechanism, so that when a user drags an image over others, they shift accordingly (like in iOS app reordering)?