Repository: flutter
Issue: atEdge property is NOT recognized when the scroll is fast
Labels: framework,f: scrolling,has reproducible steps,P2,found in release: 3.10,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. run the code sample
2. scroll up to at least index: 30
3. scroll down fast to get back to the beginning
4. you will see the screen flicker because the `atEdge` property was not emtted.

### Expected results

1. run the code sample
2. scroll up to less than index: 10
3. scroll down fast to get back to the beginning
4. No flicking occurs and the scroll stops at index:0

That's how it should be even when in the step 2.) we scroll to any index (e.g. index:30 or more)

### Actual results

`atEdge` is not recognized when the scroll is too fast

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';
const double expandedAppBarHeight = 380;
const kBackgroundColor = Color(0xFFFAFAFA);

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(MaterialApp(
    home: MyApp(),
  ));
}

class MyApp extends StatefulWidget {
  MyAppState createState() => MyAppState();
}

class MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
  var parentScrollController = ScrollController(initialScrollOffset: expandedAppBarHeight - kToolbarHeight);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        controller: parentScrollController,
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return <Widget>[
            SliverOverlapAbsorber(
              handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
              sliver: SliverAppBar(
                backgroundColor: kBackgroundColor,
                pinned: true,
                snap: false,
                floating: false,
                expandedHeight: expandedAppBarHeight,
                flexibleSpace: Container(height: expandedAppBarHeight + kToolbarHeight, color: Colors.pink),
              ),
            ),
          ];
        },
        body: DemoTab(parentController: parentScrollController),
      ),
    );
  }
}

class DemoTab extends StatefulWidget {
  ScrollController parentController;
  DemoTab({required this.parentController});

  @override
  State<DemoTab> createState() => _DemoTabState();
}

class _DemoTabState extends State<DemoTab> {
  lockParentController() {
    double defaultParentHiddenPosition = widget.parentController.position.maxScrollExtent;
    widget.parentController.jumpTo(defaultParentHiddenPosition);
  }

  @override
  void initState() {
    widget.parentController.addListener(() {
      double parentPosition = widget.parentController.offset;
      print('parentPosition: $parentPosition');
      if (lockHeader) {
        lockParentController();
        lockHeader = false;
      }
    });

    super.initState();
  }

  bool lockHeader = false;
  bool? isScrollingUp;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.only(top: kToolbarHeight + 3),
        child: NotificationListener<ScrollUpdateNotification>(
          onNotification: (notification) {
            if (notification.dragDetails != null) {
              if (notification.dragDetails!.primaryDelta != null) {
                if (notification.dragDetails!.primaryDelta! > 0) {
                  print('direction: up');
                  isScrollingUp = true;
                } else {
                  print('direction: down');
                  isScrollingUp = false;
                }
              }
            }

            if (isScrollingUp != null) {
              if (isScrollingUp! && notification.metrics.atEdge) {
                lockHeader = true;
                lockParentController();
              }
            }

            return false;
          },
          child: ListView.builder(
            // controller: ScrollController(),
            itemBuilder: (_, index) => ListTile(
              title: Text("index: ${index}"),
            ),
          ),
        ),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details>
<summary>Video demonstration</summary>


https://github.com/flutter/flutter/assets/25743901/522ffcde-b73b-49b1-8694-e21068ca81d0


</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.7.8, on macOS 13.2.1 22D68 darwin-arm64, locale en-MX)
    • Flutter version 3.7.8 on channel stable at /Users/tomas/code/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90c64ed42b (7 weeks ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] 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 (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.78.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.62.0

[✓] Connected device (4 available)
    • iPhone (mobile)            • 00008020-000415840E50003A            • ios            • iOS 16.3.1 20D67
    • iPhone 14 Pro Max (mobile) • 5B588A40-8346-4AF6-8CD8-3A54F9EC8C0A • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2
      (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 113.0.5672.92

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
```

</details>