Repository: flutter
Issue: [SelectionArea] Select all in ListView retuns "Null check operator used on a null value"
Labels: c: crash,framework,f: scrolling,has reproducible steps,P2,f: selection,has partial patch,found in release: 3.7,found in release: 3.9,team-framework,triaged-framework

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

1. Execute `flutter run` on the code sample on a Mobile device 
2. Long press on any text in listView
3. Scroll down the listView 

**Expected results:**

List items that were not visible when selecting (with select all) should appear as unselected when we scroll down to them. That is the behavior that I get when I run the app on browser : Scrolling down after "select all" does not throw the mentioned error, it just shows the remaining list items unselected (see second video below to see this)

**Actual results:**
Scrolling down the ListView after "select all" throws the following error : **Null check operator used on a null value** (see first video below demonstrating this)

<details>
<summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(SelectAll());
}

class SelectAll extends StatelessWidget {
  final ScrollController _controller = ScrollController();

  SelectAll({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SelectionArea(
        child: Scaffold(
          body: ListView.builder(
            controller: _controller,
            itemCount: 20,
            itemBuilder: (_, i) {
              return SizedBox(
                height: 100,
                child: Center(
                  child: Text('Item $i'),
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}
```
</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

```
#14     RendererBinding._handlePersistentFrameCallback
package:flutter/…/rendering/binding.dart:358
#15     SchedulerBinding._invokeFrameCallback
package:flutter/…/scheduler/binding.dart:1284
#16     SchedulerBinding.handleDrawFrame
package:flutter/…/scheduler/binding.dart:1214
#17     SchedulerBinding._handleDrawFrame
package:flutter/…/scheduler/binding.dart:1072
#18     _invoke (dart:ui/hooks.dart:142:13)
#19     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:359:5)
#20     _drawFrame (dart:ui/hooks.dart:112:31)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
Null check operator used on a null value
The relevant error-causing widget was
MaterialApp
lib\issues\selectAll.dart:13
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
Null check operator used on a null value
The relevant error-causing widget was
MaterialApp
lib\issues\selectAll.dart:13
════════════════════════════════════════════════════════════════════════════════

```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing flutter_application_1...
No issues found! (ran in 6.1s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel master, 3.9.0-17.0.pre.21, on Microsoft Windows [version 10.0.19045.2728], locale en-US)
    • Flutter version 3.9.0-17.0.pre.21 on channel master at C:\Users\hp\Desktop\My Flutter Clone\flutter
    • Upstream repository https://github.com/Sarraj-Sahar/flutter.git
    • FLUTTER_GIT_URL = https://github.com/Sarraj-Sahar/flutter.git
    • Framework revision 4831dd99ef (10 days ago), 2023-03-24 23:17:14 +0000
    • Engine revision 6c2dafed50
    • Dart version 3.0.0 (build 3.0.0-366.0.dev)
    • DevTools version 2.22.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc2)
    • Android SDK at C:\Users\hp\AppData\Local\Android\sdk
    • Platform android-33, build-tools 34.0.0-rc2
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)   
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 11.0.15+0-b2043.56-8887301)

[√] VS Code, 64-bit edition
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.40.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [version 10.0.19045.2728]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 111.0.5563.147
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 111.0.1661.62

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->
**Result on mobile device that throws the error:**

https://user-images.githubusercontent.com/82158584/229651420-12c13a7b-3f1f-4ac2-81b9-195aa9e8a6f1.mp4


**Results on web browser:**

[2.webm](https://user-images.githubusercontent.com/82158584/229652164-b2655d5a-4de5-4849-9dbc-abbc6f8f6e45.webm)