Open a1573595 opened 6 months ago
Thanks for the report @a1573595
Can you try to verify if this PR resolves your issue or not ?
If yes, then, you may follow-up in that issue for updates. If not, can you provide us main.g.dart
for this issue ?
Thanks for the report @a1573595 Can you try to verify if this PR resolves your issue or not ? If yes, then, you may follow-up in that issue for updates. If not, can you provide us
main.g.dart
for this issue ?
Not work.
Thanks for the update. I was able to replicate using details provided. Looking at the error log, it may be similar / duplicate of other existing issues but use case is different so will keep this issue open.
in your PopScope, do this:
onPopInvoked: (didPop) { if (didPop) return; context.pop(); },
need to wait for next stable release of flutter before fixing this
@chunhtai any updates on this? I'm still experiencing the issue with Flutter 3.24.1 and go_router 14.2.7
go_router: ^14.0.2 go_router_builder: ^2.6.2
Steps to reproduce
Related issue: #119677 #137545 #138737
Expected results
Back to the first page without exception.
Actual results
Throw “Null check operator used on a null value”.
Code sample
Code sample
```dart import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; part 'main.g.dart'; void main() => runApp(MaterialApp.router(routerConfig: appRouter)); final appRouter = GoRouter( routes: $appRoutes, ); @TypedGoRouteScreenshots or Video
Screenshots / Video demonstration
![截圖 2024-05-08 上午11 15 53](https://github.com/flutter/flutter/assets/25738593/cf01d6df-72bb-4202-bbec-239b7d022a40)Logs
Logs
```console ======== Exception caught by widgets library ======================================================= The following _TypeError was thrown building HeroControllerScope: Null check operator used on a null value The relevant error-causing widget was: MaterialApp MaterialApp:file:///Users/chien/Flutter/untitled4/lib/main.dart:6:35 When the exception was thrown, this was the stack: #0 _CustomNavigatorState._handlePopPage (package:go_router/src/builder.dart:415:61) #1 NavigatorState.pop (package:flutter/src/widgets/navigator.dart:5284:28) #2 GoRouterDelegate.pop (package:go_router/src/delegate.dart:115:11) #3 GoRouter.pop (package:go_router/src/router.dart:490:20) #4 GoRouterHelper.pop (package:go_router/src/misc/extensions.dart:71:65) #5 SecondPage.build.Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale zh-Hant-TW) • Flutter version 3.19.6 on channel stable at /Library/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 54e66469a9 (3 weeks ago), 2024-04-17 13:08:03 -0700 • Engine revision c4cd48e186 • Dart version 3.3.4 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/chien/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_SDK_ROOT = /Users/chien/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.0 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.3) • 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 17.0.10+0-17.0.10b1087.21-11572160) [✓] IntelliJ IDEA Community Edition (version 2024.1.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin version 241.15989.9 [✓] VS Code (version 1.89.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.88.0 [✓] Connected device (4 available) • Android SDK built for arm64 (mobile) • emulator-5554 • android-arm64 • Android 9 (API 28) (emulator) • iPhone SE (3rd generation) (mobile) • 0F2A5E6F-C1A4-4496-942F-E4AFE7E3067C • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.119 ! Error: Browsing on the local area network for Cybertan iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources • All expected network resources are available. ```