Repository: flutter
Issue: WidgetTester.fling initialOffset drag is non functional
Labels: a: tests,framework,has reproducible steps,P3,team-framework,triaged-framework,found in release: 3.16,found in release: 3.18

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Copy code sample in a file called `test.dart` inside `test` folder
2. Open simulator
3. Run with `flutter run -t test/test.dart`

### Expected results


`WidgetTester.fling / flingFrom` methods have an `initialOffset` to simulate a drag before the fling, to allow complex gestures in testing. This `initialOffset` property is non functional is most cases as to perform a drag bigger than `kDragSlopDefault (20px)`, the drag needs to be divided into smaller "moves" for the gesture to work correctly. This can be seen in the implementation of `WidgetTester.drag / dragFrom`.

from fling docs:
<details>The initialOffset argument, if non-zero, causes the pointer to first apply that offset, then pump a delay of initialOffsetDelay. This can be used to simulate a drag followed by a fling, including dragging in the opposite direction of the fling (e.g. dragging 200 pixels to the right, then fling to the left over 200 pixels, ending at the exact point that the drag started).</details>

### Actual results

The cursor is moved to the offset, but no drag is performed. Then the fling does execute.

### Code sample

<details><summary>Code sample</summary>


**Copy in test folder as test.dart**

Run with
```
flutter run -t test/test.dart
```

```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets('WidgetTester.fling initialOffset should drag a bottomSheet', (WidgetTester tester) async {

    final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
    bool showBottomSheetThenCalled = false;

    const double sheetHeight = 500;

    await tester.pumpWidget(MaterialApp(
      home: Scaffold(
        key: scaffoldKey,
        body: const Center(child: Text('body')),
      ),
    ));

    await tester.pump();
    expect(showBottomSheetThenCalled, isFalse);
    expect(find.text('BottomSheet'), findsNothing);

    scaffoldKey.currentState!
        .showBottomSheet((BuildContext context) => const SizedBox(
              height: sheetHeight,
              child: Align(
                alignment: Alignment.topCenter,
                child: ColoredBox(color: Colors.blue, child: Text('BottomSheet')),
              ),
            ))
        .closed
        .whenComplete(() => showBottomSheetThenCalled = true);

    await tester.pumpAndSettle();
    expect(showBottomSheetThenCalled, isFalse);
    expect(find.text('BottomSheet'), findsOneWidget);

    await tester.flingFrom(
      tester.getCenter(find.text('BottomSheet')),
      const Offset(0, 100),
      10, // _kminFlingVelocity == 700 pixels/second
      initialOffset: const Offset(0, sheetHeight * 0.8),
      initialOffsetDelay: const Duration(seconds: 1),
    );

    await tester.pumpAndSettle();
    expect(showBottomSheetThenCalled, isFalse);
  });
}
```

</details>


### Screenshots or Video
For actual behavior see [video below](https://github.com/flutter/flutter/issues/139455#issuecomment-1838323397)
<details><summary>Expected behavior</summary>

https://github.com/flutter/flutter/assets/114481466/582638eb-c0ca-4f63-9d4f-cd9dc73d8251


</details>

### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.16.0, on macOS)
    • Flutter version 3.16.0 on channel stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db7ef5bf9f (3 weeks ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users//Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = /Users//Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.13.0

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.78.0

[✓] Connected device (1 available)
    • iPhone 14 (mobile) •  com.apple.CoreSimulator.SimRuntime.iOS-16-1
      (simulator)

[✓] Network resources
    • All expected network resources are available.
```

</details>