Repository: flutter
Issue: Error in onScaleEnd method result parameters
Labels: framework,f: gestures,has reproducible steps,P2,found in release: 3.7,found in release: 3.11,team-framework,triaged-framework

### 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. use GestureDetector widget
2. Register listening for onScaleEnd 
3. Swipe from left to right until the mouse moves outside the iOS emulator screen, or the interaction quickly stops and raises the finger

### Expected results

The velocity in the corresponding direction of velocity.dx in ScaleEndDetails

### Actual results

Inertia velocity occurs in the reverse direction

### Code sample

<details><summary>Code sample</summary>

```dart
LayoutBuilder(
      builder: (context, constraints) {

        return GestureDetector(
          onTapDown: (_) {
         
          },
          behavior: HitTestBehavior.opaque,
          onTapUp: (details) {
          
          },
          onScaleStart: (_) {
       
          },
          onScaleUpdate: (details) {
            debugPrint(
                'onScaleUpdate  : details.focalPointDelta.dx : ${details.focalPointDelta.dx}');
          },
          onScaleEnd: (ScaleEndDetails details) {
            debugPrint(
                'onScaleEnd details.velocity.pixelsPerSecond.dx : ${details.velocity.pixelsPerSecond.dx}');
      
          },
          onLongPressStart: (details) {
          
          },
          onLongPressMoveUpdate: (details) {
           
          },
          onLongPressEnd: (details) {
         
          },
        );
      },
    )
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
flutter: onScaleUpdate  : details.focalPointDelta.dx : 21.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 24.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 22.333328247070312
flutter: onScaleUpdate  : details.focalPointDelta.dx : 17.666671752929688
flutter: onScaleUpdate  : details.focalPointDelta.dx : 16.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 9.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 10.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 7.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 9.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 13.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 12.333328247070312
flutter: onScaleUpdate  : details.focalPointDelta.dx : 15.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 18.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 14.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 12.666671752929688
flutter: onScaleUpdate  : details.focalPointDelta.dx : 9.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 6.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 6.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 4.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 2.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 1.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.3333282470703125
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.6666717529296875
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.6666717529296875
flutter: onScaleUpdate  : details.focalPointDelta.dx : 2.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.6666717529296875
flutter: onScaleEnd details.velocity.pixelsPerSecond.dx : -7077.865558293501flutter: onScaleUpdate  : details.focalPointDelta.dx : 21.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 24.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 22.333328247070312
flutter: onScaleUpdate  : details.focalPointDelta.dx : 17.666671752929688
flutter: onScaleUpdate  : details.focalPointDelta.dx : 16.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 9.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 10.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 7.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 9.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 13.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 12.333328247070312
flutter: onScaleUpdate  : details.focalPointDelta.dx : 15.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 18.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 14.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 12.666671752929688
flutter: onScaleUpdate  : details.focalPointDelta.dx : 9.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 6.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 6.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 4.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 2.333343505859375
flutter: onScaleUpdate  : details.focalPointDelta.dx : 1.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.3333282470703125
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.6666717529296875
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.666656494140625
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.6666717529296875
flutter: onScaleUpdate  : details.focalPointDelta.dx : 2.0
flutter: onScaleUpdate  : details.focalPointDelta.dx : 0.6666717529296875
flutter: onScaleEnd details.velocity.pixelsPerSecond.dx : -7077.865558293501
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
❯ flutter doctor -v                                                                                                                                                                               ─╯
[✓] Flutter (Channel stable, 3.7.5, on macOS 13.2.1 22D68 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.7.5 on channel stable at /Users/chao/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c07f788888 (2 months ago), 2023-02-22 17:52:33 -0600
    • Engine revision 0f359063c4
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc3)
    • Android SDK at /Users/chao/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc3
    • ANDROID_HOME = /Users/chao/Library/Android/sdk
    • Java binary at: /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.77.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.60.0

[✓] Connected device (3 available)
    • iPhone 14 (mobile) •
    • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)    • macos                                
    • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)       • chrome                              

[✓] HTTP Host Availability
    • All required HTTP hosts are available


```

</details>