43

+
                _controller.dispose();

38
44

super.dispose();

39
45

Step 2: Move the widget using gestures

Make the widget move when it’s dragged, and add an Alignment field to the
_DraggableCardState class:

lib/{step1.dart (alignment) → step2.dart (alignment)}

@@ -1,3 +1,4 @@

1
1

class _DraggableCardState extends State<DraggableCard>

2
2

with SingleTickerProviderStateMixin {

3
3

late AnimationController _controller;

+
              Alignment _dragAlignment = Alignment.center;

GestureDetector that handles the