2

I am trying to create a small test that allows a user to click or drag a Draggable or Container to move it to a DragTarget. The best example I can think of for this would be how Duolingo allows for their users to click a word and automatically move it to the first location of a sentence to a certain target, then the app checks if the sequence is correct.

For those who are unfamiliar with how Duolingo uses this, I'll explain what I would like to do here. I would like to have 3 Draggables (call them A, B, and C), and 3 DragTargets. When a letter is clicked it will move to the leftmost empty DragTarget, however, the letter could also be dragged to the location as well. If a Draggable is clicked while inside the DragTarget it will return to its original location, or it could be dragged to switch spots with another filled DragTarget.

I hope that explained my goal well. If not please ask for more details and I can try to edit and provide them.

Thanks

aczich
  • 140
  • 11

1 Answers1

0

What could work is to use the onDragStarted: () {} voidCallback which will be similar to a button click. You could use A Stack() and wrap the Draggables with an AnimatedPositioned() widget. To which field to move can propably be determined using If statements.

Yusuf-Uluc
  • 887
  • 4
  • 15