feat: Add velocity to DragTargetDetails
This commit adds a velocity parameter to the DragTargetDetails class, and where this class is used, supplies the velocity to this new parameter.
Fixes https://github.com/flutter/flutter/issues/165878
diff --git a/packages/flutter/lib/src/widgets/drag_target.dart b/packages/flutter/lib/src/widgets/drag_target.dart
index 5f087bd..35266c0 100644
--- a/packages/flutter/lib/src/widgets/drag_target.dart
+++ b/packages/flutter/lib/src/widgets/drag_target.dart
@@ -885,8 +885,8 @@
@override
void update(DragUpdateDetails details) {
final Offset oldPosition = _position;
+ velocity = Velocity(pixelsPerSecond: details.delta);
_position += _restrictAxis(details.delta);
- velocity = Velocity(pixelsPerSecond: _position - oldPosition);
updateDrag(_position);
if (onDragUpdate != null && _position != oldPosition) {
onDragUpdate!(details);