Repository: flutter
Issue: Incorrect position in first update from MultiDragGestureRecognizer
Labels: c: new feature,framework,f: gestures,has reproducible steps,P3,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

## Steps to Reproduce

1. Execute `flutter run` on the code sample to run on a phone
2. Try a few drag gestures (with and without holding the finger down for a while first)

**Expected results:** The first drag update carries a different offset from the one supplied to the onStart callback

**Actual results:** The first drag update always has the same offset as in onStart callback despite delta being correct. Additionally, the `DragUpdateDetails.localPosition` field isn't provided meaning it will default to `.globalPosition` so it can't be relied on.

```
I/flutter (30743): _handleDragStart Offset(157.4, 413.1)
I/flutter (30743): _handleDragUpdate localPosition=Offset(157.4, 413.1) globalPosition=Offset(157.4, 413.1) delta=Offset(14.3, -13.7) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(173.7, 398.0) globalPosition=Offset(173.7, 398.0) delta=Offset(2.0, -1.4) primaryDelta=null
I/flutter (30743): _handleDragEnd
```

```
I/flutter (30743): _handleTapDown Offset(128.6, 227.4)
I/flutter (30743): _handleDragStart Offset(134.3, 409.1)
I/flutter (30743): _handleDragUpdate localPosition=Offset(134.3, 409.1) globalPosition=Offset(134.3, 409.1) delta=Offset(11.1, -14.3) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(148.0, 392.6) globalPosition=Offset(148.0, 392.6) delta=Offset(2.6, -2.3) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(150.6, 390.3) globalPosition=Offset(150.6, 390.3) delta=Offset(2.6, -2.3) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(152.9, 388.3) globalPosition=Offset(152.9, 388.3) delta=Offset(2.3, -2.0) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(154.6, 386.9) globalPosition=Offset(154.6, 386.9) delta=Offset(1.7, -1.4) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(156.0, 385.7) globalPosition=Offset(156.0, 385.7) delta=Offset(1.4, -1.1) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(157.1, 384.6) globalPosition=Offset(157.1, 384.6) delta=Offset(1.1, -1.1) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(158.0, 383.7) globalPosition=Offset(158.0, 383.7) delta=Offset(0.9, -0.9) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(158.9, 383.1) globalPosition=Offset(158.9, 383.1) delta=Offset(0.9, -0.6) primaryDelta=null
I/flutter (30743): _handleDragUpdate localPosition=Offset(160.3, 382.3) globalPosition=Offset(160.3, 382.3) delta=Offset(1.4, -0.9) primaryDelta=null
I/flutter (30743): _handleDragEnd
```

<details>
<summary>Code sample</summary>

```dart
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  void _handleTapDown(TapDownDetails details) {
    print('_handleTapDown ${details.localPosition}');
  }

  void _handleTapUp(TapUpDetails details) {
    print('_handleTapUp ${details.localPosition}');
  }
 
  Drag? _handleDragStart(Offset position) {
    print('_handleDragStart $position');
    return _DragHandler(_handleDragUpdate, _handleDragCancel, _handleDragEnd);
  }

  void _handleDragUpdate(DragUpdateDetails details) {
    print('_handleDragUpdate localPosition=${details.localPosition} globalPosition=${details.globalPosition} '
        'delta=${details.delta} primaryDelta=${details.primaryDelta}');
  }

  void _handleDragCancel() {
    print('_handleDragCancel');
  }

  void _handleDragEnd(DragEndDetails details) {
    print('_handleDragEnd');
  }

  @override
  Widget build(BuildContext context) {
    final Map<Type, GestureRecognizerFactory> gestures = <Type, GestureRecognizerFactory>{
      TapGestureRecognizer: GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
        () => TapGestureRecognizer(debugOwner: this),
        (TapGestureRecognizer instance) {
          instance
            ..onTapDown = _handleTapDown
            ..onTapUp = _handleTapUp;
        },
      ),
      ImmediateMultiDragGestureRecognizer: GestureRecognizerFactoryWithHandlers<ImmediateMultiDragGestureRecognizer>(
        () => ImmediateMultiDragGestureRecognizer(debugOwner: this),
        (ImmediateMultiDragGestureRecognizer instance) {
          instance.onStart = _handleDragStart;
        },
      ),
    };

    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: Center(
        child: Container(
          width: 400.0,
          height: 400.0,
          color: Colors.red,
          child: RawGestureDetector(
            gestures: gestures,
          ),
        ),
      ),
    );
  }
}

class _DragHandler extends Drag {
  _DragHandler(this.onUpdate, this.onCancel, this.onEnd);

  final GestureDragUpdateCallback onUpdate;
  final GestureDragCancelCallback onCancel;
  final GestureDragEndCallback onEnd;

  @override
  void update(DragUpdateDetails details) {
    onUpdate(details);
  }

  @override
  void cancel() {
    onCancel();
  }

  @override
  void end(DragEndDetails details) {
    onEnd(details);
  }
}
```

</details>

<details>
  <summary>Logs</summary>

```
```

</details>