Repository: flutter
Issue: _TypeError  framework.dart in Element.widget
Labels: c: crash,framework,a: production,P3,needs repro info,team-framework,triaged-framework

### Steps to reproduce

found in Sentry. Seems to be related that we use a new Flutter version in our latest release. 

### Expected results

no exception

### Actual results

seems only to happen on iOS
```
_TypeError: Null check operator used on a null value
  File "framework.dart", line 3484, in Element.widget
  File "framework.dart", line 4820, in Element.findAncestorWidgetOfExactType
  File "page_storage.dart", line 194, in PageStorage.maybeOf
  File "scroll_position.dart", line 511, in ScrollPosition.restoreScrollOffset
  File "scroll_position.dart", line 192, in new ScrollPosition
  File "scroll_position_with_single_context.dart", in new ScrollPositionWithSingleContext
  File "scroll_controller.dart", line 291, in ScrollController.createScrollPosition
  File "scrollable.dart", line 603, in ScrollableState._updatePosition
  File "scrollable.dart", line 638, in ScrollableState.didChangeDependencies
  File "framework.dart", line 5636, in StatefulElement._firstBuild
  File "framework.dart", line 5463, in ComponentElement.mount
  File "framework.dart", line 4340, in Element.inflateWidget
  File "framework.dart", line 3843, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 3976, in Element.updateChildren
  File "framework.dart", line 6929, in MultiChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5650, in StatefulElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5673, in StatefulElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5816, in ProxyElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5816, in ProxyElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5816, in ProxyElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5816, in ProxyElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5650, in StatefulElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5673, in StatefulElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 6776, in SingleChildRenderObjectElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 5563, in StatelessElement.update
  File "framework.dart", line 3827, in Element.updateChild
  File "framework.dart", line 5512, in ComponentElement.performRebuild
  File "framework.dart", line 5203, in Element.rebuild
  File "framework.dart", line 2905, in BuildOwner.buildScope
  File "binding.dart", line 1136, in WidgetsBinding.drawFrame
  File "binding.dart", line 443, in RendererBinding._handlePersistentFrameCallback
  File "binding.dart", line 1392, in SchedulerBinding._invokeFrameCallback
  File "binding.dart", line 1313, in SchedulerBinding.handleDrawFrame
  File "binding.dart", line 1171, in SchedulerBinding._handleDrawFrame
  File "zone.dart", line 1399, in _rootRun
  File "zone.dart", line 1301, in _CustomZone.run
  File "zone.dart", line 1209, in _CustomZone.runGuarded
  File "hooks.dart", line 314, in _invoke
  File "platform_dispatcher.dart", line 419, in PlatformDispatcher._drawFrame
  File "hooks.dart", line 283, in _drawFrame`
```

### Code sample

<details open><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [Version 10.0.19045.4651], locale de-DE)
    • Flutter version 3.22.0 on channel stable at C:\Users\escam\fvm\versions\3.22.0
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (10 weeks ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\escam\AppData\Local\Android\sdk
    • Platform android-34, build-tools 33.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.2)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.6.33723.286
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
    • 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 17.0.6+0-b2043.56-9586694)

[√] VS Code, 64-bit edition (version 1.91.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.92.0

[√] Connected device (4 available)
    • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • Windows (desktop)          • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.4651]
    • Chrome (web)               • chrome        • web-javascript • Google Chrome 126.0.6478.127
    • Edge (web)                 • edge          • web-javascript • Microsoft Edge 126.0.2592.102

[√] Network resources
    • All expected network resources are available.

```

</details>