Repository: flutter
Issue: Scroll up by tapping a status bar on iOS does NOT work after a hot restart with PrimaryScrollController
Labels: platform-ios,framework,t: hot reload,f: scrolling,has reproducible steps,P2,found in release: 3.0,found in release: 3.1,customer: flex,team-ios,triaged-ios

<!-- 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

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
2. Hot restart
3. Drag down and tap on the status bar to scroll up

**Expected results:** <!-- what did you want to see? -->

Scroll to the top on tapping a status bar works after a hot restart

**Actual results:** <!-- what did you see? -->

Scroll to the top on tapping a status bar does NOT work after a hot restart

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```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> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListView.builder(
        controller: PrimaryScrollController.of(context),
        itemCount: 100,
        itemBuilder: (context, index) => ListTile(
          leading: Text(
            index.toString(),
          ),
        ),
      ),
    );
  }
}
```

</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.
-->


<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->


<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm,
    locale en-US)
    • Flutter version 3.0.2 at /Users/heeyunlee/fvm/versions/3.0.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cd41fdd495 (6 days ago), 2022-06-08 09:52:13
      -0700
    • Engine revision f15f824b57
    • Dart version 2.17.3
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK
    version 32.1.0-rc1)
    • Android SDK at /Users/heeyunlee/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google
      Chrome

[✓] Android Studio (version 2021.1)
    • 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
      11.0.11+0-b60-7772763)

[✓] VS Code (version 1.68.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.42.0

[✓] Connected device (4 available)
    • Pixel 4a (mobile)      • 0A301JEC212254                       •
      android-arm64  • Android 12 (API 32)
    • iPhone 12 Pro (mobile) • FDBB3C7F-05A3-4DAB-8778-60D74534E5D6 •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-5
      (simulator)
    • macOS (desktop)        • macos                                •
      darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 102.0.5005.115

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>


https://user-images.githubusercontent.com/32585133/173683390-569ce104-dd9b-4dc0-a3ef-2405b1c53b0a.mov


<!--
      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.
-->