flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.29k stars 27.52k forks source link

[go_router] TypedGoRoute seems to be incompatible with PopScope #147959

Open a1573595 opened 6 months ago

a1573595 commented 6 months ago

go_router: ^14.0.2 go_router_builder: ^2.6.2

Steps to reproduce

  1. Click FloatingActionButton to go to the second page.
  2. Click appbar back button.

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, ); @TypedGoRoute( path: '/', routes: [ TypedGoRoute( path: 'second', ), ], ) class FirstRoute extends GoRouteData { @override Widget build(BuildContext context, GoRouterState state) => const FirstPage(); } class SecondRoute extends GoRouteData { @override Widget build(BuildContext context, GoRouterState state) => const SecondPage(); } class FirstPage extends StatelessWidget { const FirstPage({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), floatingActionButton: FloatingActionButton(onPressed: () => SecondRoute().go(context)), ); } } class SecondPage extends StatelessWidget { const SecondPage({super.key}); @override Widget build(BuildContext context) { return PopScope( canPop: false, onPopInvoked: (_) { context.pop(); }, child: Scaffold( appBar: AppBar(), ), ); } } ```

Screenshots 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. (package:untitled4/main.dart:50:17) #6 ModalRoute.onPopInvoked (package:flutter/src/widgets/routes.dart:1578:30) #7 _RouteEntry.pop (package:flutter/src/widgets/navigator.dart:3116:11) #8 _RouteEntry.markForPop (package:flutter/src/widgets/navigator.dart:3322:5) #9 DefaultTransitionDelegate.resolve.handleExitingRoute (package:flutter/src/widgets/navigator.dart:1105:28) #10 DefaultTransitionDelegate.resolve (package:flutter/src/widgets/navigator.dart:1144:7) #11 TransitionDelegate._transition (package:flutter/src/widgets/navigator.dart:921:53) #12 NavigatorState._updatePages (package:flutter/src/widgets/navigator.dart:4181:43) #13 NavigatorState.didUpdateWidget (package:flutter/src/widgets/navigator.dart:3841:7) #14 StatefulElement.update (package:flutter/src/widgets/framework.dart:5652:55) #15 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #16 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #17 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #18 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5) #19 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #20 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #21 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #22 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5) #23 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11) #24 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #25 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #26 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11) #27 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #28 StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5) #29 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #30 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #31 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #32 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5) #33 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #34 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #35 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #36 StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5) #37 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #38 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #39 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #40 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5) #41 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #42 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #43 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #44 ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5) #45 Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15) #46 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #47 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11) #48 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #49 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19) #50 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21) #51 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5) #52 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15) #53 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9) #54 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5) #55 _invoke (dart:ui/hooks.dart:312:13) #56 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5) #57 _drawFrame (dart:ui/hooks.dart:283:31) ==================================================================================================== ======== Exception caught by widgets library ======================================================= The following assertion was thrown building Navigator-[LabeledGlobalKey#61df0](dirty, dependencies: [HeroControllerScope, UnmanagedRestorationScope], state: NavigatorState#f66f1(tickers: tracking 2 tickers)): 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 5534 pos 12: '!_debugLocked': is not true. Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=2_bug.yml 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: #2 NavigatorState.build (package:flutter/src/widgets/navigator.dart:5534:12) #3 StatefulElement.build (package:flutter/src/widgets/framework.dart:5592:27) #4 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5480:15) #5 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11) #6 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #7 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19) #8 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21) #9 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5) #10 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15) #11 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9) #12 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5) #13 _invoke (dart:ui/hooks.dart:312:13) #14 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5) #15 _drawFrame (dart:ui/hooks.dart:283:31) (elided 2 frames from class _AssertionError) ==================================================================================================== ======== Exception caught by widgets library ======================================================= The following assertion was thrown building Navigator-[LabeledGlobalKey#61df0](dependencies: [HeroControllerScope, UnmanagedRestorationScope], state: NavigatorState#f66f1(tickers: tracking 2 tickers)): 'package:flutter/src/widgets/framework.dart': Failed assertion: line 6786 pos 12: 'renderObject.child == child': is not true. Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=2_bug.yml 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: #2 SingleChildRenderObjectElement.removeRenderObjectChild (package:flutter/src/widgets/framework.dart:6786:12) #3 RenderObjectElement.detachRenderObject (package:flutter/src/widgets/framework.dart:6601:37) #4 Element.detachRenderObject. (package:flutter/src/widgets/framework.dart:4202:13) #5 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14) #6 Element.detachRenderObject (package:flutter/src/widgets/framework.dart:4201:5) #7 Element.detachRenderObject. (package:flutter/src/widgets/framework.dart:4202:13) #8 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14) #9 Element.detachRenderObject (package:flutter/src/widgets/framework.dart:4201:5) #10 Element.deactivateChild (package:flutter/src/widgets/framework.dart:4376:11) #11 Element.updateChild (package:flutter/src/widgets/framework.dart:3835:9) #12 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16) #13 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11) #14 Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7) #15 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19) #16 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21) #17 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5) #18 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15) #19 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9) #20 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5) #21 _invoke (dart:ui/hooks.dart:312:13) #22 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5) #23 _drawFrame (dart:ui/hooks.dart:283:31) (elided 2 frames from class _AssertionError) ==================================================================================================== ======== Exception caught by scheduler library ===================================================== The following assertion was thrown during a scheduler callback: Tried to build dirty widget in the wrong build scope. A widget which was marked as dirty and is still active was scheduled to be built, but the current build scope unexpectedly does not contain that widget. Sometimes this is detected when an element is removed from the widget tree, but the element somehow did not get marked as inactive. In that case, it might be caused by an ancestor element failing to implement visitChildren correctly, thus preventing some or all of its descendants from being correctly deactivated. The root of the build scope was: [root] The offending element (which does not appear to be a descendant of the root of the build scope) was: _IconButtonM3 style: ButtonStyle#5600b(mouseCursor: _IconButtonDefaultMouseCursor#4636e) dirty dependencies: [IconButtonTheme, IconTheme, _InheritedTheme, _LocalizationsScope-[GlobalKey#28302]] state: _ButtonStyleState#2e9e8 When the exception was thrown, this was the stack: #0 BuildOwner.buildScope. (package:flutter/src/widgets/framework.dart:2863:13) #1 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2888:10) #2 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21) #3 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5) #4 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15) #5 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9) #6 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5) #7 _invoke (dart:ui/hooks.dart:312:13) #8 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5) #9 _drawFrame (dart:ui/hooks.dart:283:31) ==================================================================================================== ```

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. ```
darshankawar commented 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 ?

a1573595 commented 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 ?

Not work.

Code sample

Code sample ```dart // GENERATED CODE - DO NOT MODIFY BY HAND part of 'main.dart'; // ************************************************************************** // GoRouterGenerator // ************************************************************************** List get $appRoutes => [ $firstRoute, ]; RouteBase get $firstRoute => GoRouteData.$route( path: '/', factory: $FirstRouteExtension._fromState, routes: [ GoRouteData.$route( path: 'second', factory: $SecondRouteExtension._fromState, ), ], ); extension $FirstRouteExtension on FirstRoute { static FirstRoute _fromState(GoRouterState state) => FirstRoute(); String get location => GoRouteData.$location( '/', ); void go(BuildContext context) => context.go(location); Future push(BuildContext context) => context.push(location); void pushReplacement(BuildContext context) => context.pushReplacement(location); void replace(BuildContext context) => context.replace(location); } extension $SecondRouteExtension on SecondRoute { static SecondRoute _fromState(GoRouterState state) => SecondRoute(); String get location => GoRouteData.$location( '/second', ); void go(BuildContext context) => context.go(location); Future push(BuildContext context) => context.push(location); void pushReplacement(BuildContext context) => context.pushReplacement(location); void replace(BuildContext context) => context.replace(location); } ```

Screenshots or Video

Screenshots / Video demonstration ![截圖 2024-05-09 清晨7 52 41](https://github.com/flutter/flutter/assets/25738593/8343e448-2e52-4971-964c-bafaedbd5b15)

Logs

Logs ```console ✓ Built build/app/outputs/flutter-apk/app-debug.apk Installing build/app/outputs/flutter-apk/app-debug.apk... Debug service listening on ws://127.0.0.1:56864/kfjjCSnrOrs=/ws Syncing files to device sdk gphone64 arm64... W/WindowOnBackDispatcher( 4751): OnBackInvokedCallback is not enabled for the application. W/WindowOnBackDispatcher( 4751): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest. D/EGL_emulation( 4751): app_time_stats: avg=2597.12ms min=4.49ms max=5189.76ms count=2 D/EGL_emulation( 4751): app_time_stats: avg=73.52ms min=0.97ms max=915.95ms count=13 E/flutter ( 4751): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 5350 pos 12: '!_debugLocked': is not true. E/flutter ( 4751): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:50:61) E/flutter ( 4751): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) E/flutter ( 4751): #2 NavigatorState.pop (package:flutter/src/widgets/navigator.dart:5350:12) E/flutter ( 4751): #3 GoRouterDelegate.pop (package:go_router/src/delegate.dart:115:11) E/flutter ( 4751): #4 GoRouter.pop (package:go_router/src/router.dart:490:20) E/flutter ( 4751): #5 GoRouterHelper.pop (package:go_router/src/misc/extensions.dart:71:65) E/flutter ( 4751): #6 SecondPage.build. (package:untitled4/main.dart:50:17) E/flutter ( 4751): #7 PopScope._callPopInvoked (package:flutter/src/widgets/pop_scope.dart:140:19) E/flutter ( 4751): #8 _PopScopeState.onPopInvokedWithResult (package:flutter/src/widgets/pop_scope.dart:172:12) E/flutter ( 4751): #9 ModalRoute.onPopInvokedWithResult (package:flutter/src/widgets/routes.dart:1741:16) E/flutter ( 4751): #10 NavigatorState.pop (package:flutter/src/widgets/navigator.dart:5362:19) E/flutter ( 4751): #11 GoRouterDelegate.pop (package:go_router/src/delegate.dart:115:11) E/flutter ( 4751): #12 GoRouter.pop (package:go_router/src/router.dart:490:20) E/flutter ( 4751): #13 GoRouterHelper.pop (package:go_router/src/misc/extensions.dart:71:65) E/flutter ( 4751): #14 SecondPage.build. (package:untitled4/main.dart:50:17) E/flutter ( 4751): #15 PopScope._callPopInvoked (package:flutter/src/widgets/pop_scope.dart:140:19) E/flutter ( 4751): #16 _PopScopeState.onPopInvokedWithResult (package:flutter/src/widgets/pop_scope.dart:172:12) E/flutter ( 4751): #17 ModalRoute.onPopInvokedWithResult (package:flutter/src/widgets/routes.dart:1741:16) E/flutter ( 4751): #18 NavigatorState.maybePop (package:flutter/src/widgets/navigator.dart:5319:25) E/flutter ( 4751): E/flutter ( 4751): W/WindowOnBackDispatcher( 4751): OnBackInvokedCallback is not enabled for the application. W/WindowOnBackDispatcher( 4751): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest. ======== Exception caught by widgets library ======================================================= The following GoError was thrown building HeroControllerScope: There is nothing to pop 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 GoRouterDelegate.pop (package:go_router/src/delegate.dart:113:7) #1 GoRouter.pop (package:go_router/src/router.dart:490:20) #2 GoRouterHelper.pop (package:go_router/src/misc/extensions.dart:71:65) #3 SecondPage.build. (package:untitled4/main.dart:50:17) #4 PopScope._callPopInvoked (package:flutter/src/widgets/pop_scope.dart:140:19) #5 _PopScopeState.onPopInvokedWithResult (package:flutter/src/widgets/pop_scope.dart:172:12) #6 ModalRoute.onPopInvokedWithResult (package:flutter/src/widgets/routes.dart:1741:16) #7 _RouteEntry.handlePop (package:flutter/src/widgets/navigator.dart:3171:11) #8 NavigatorState._flushHistoryUpdates (package:flutter/src/widgets/navigator.dart:4340:22) #9 NavigatorState._updatePages (package:flutter/src/widgets/navigator.dart:4270:5) #10 NavigatorState.didUpdateWidget (package:flutter/src/widgets/navigator.dart:3911:7) #11 StatefulElement.update (package:flutter/src/widgets/framework.dart:5653:55) #12 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #14 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #15 ProxyElement.update (package:flutter/src/widgets/framework.dart:5810:5) #16 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #17 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #18 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #19 ProxyElement.update (package:flutter/src/widgets/framework.dart:5810:5) #20 _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11) #21 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #22 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #23 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5644:11) #24 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #25 StatefulElement.update (package:flutter/src/widgets/framework.dart:5667:5) #26 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #27 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #28 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #29 ProxyElement.update (package:flutter/src/widgets/framework.dart:5810:5) #30 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #31 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #32 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #33 StatelessElement.update (package:flutter/src/widgets/framework.dart:5557:5) #34 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #35 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #36 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #37 ProxyElement.update (package:flutter/src/widgets/framework.dart:5810:5) #38 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #39 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #40 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #41 ProxyElement.update (package:flutter/src/widgets/framework.dart:5810:5) #42 Element.updateChild (package:flutter/src/widgets/framework.dart:3821:15) #43 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5506:16) #44 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5644:11) #45 Element.rebuild (package:flutter/src/widgets/framework.dart:5197:7) #46 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2905:19) #47 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1136:21) #48 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:468:5) #49 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1392:15) #50 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1313:9) #51 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1171:5) #52 _invoke (dart:ui/hooks.dart:312:13) #53 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5) #54 _drawFrame (dart:ui/hooks.dart:283:31) ==================================================================================================== Application finished. ```
darshankawar commented 6 months ago

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.

stable, master flutter doctor -v ``` [!] Flutter (Channel stable, 3.19.6, on macOS 12.2.1 21D62 darwin-x64, locale en-GB) • Flutter version 3.19.6 on channel stable at /Users/dhs/documents/fluttersdk/flutter ! Warning: `flutter` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 54e66469a9 (6 days ago), 2024-04-17 13:08:03 -0700 • Engine revision c4cd48e186 • Dart version 3.3.4 • DevTools version 2.31.1 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [!] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer ! Flutter recommends a minimum Xcode version of 13. Download the latest version or update via the Mac App Store. • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (5 available) • SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. [!] Flutter (Channel master, 3.22.0-27.0.pre.12, on macOS 12.2.1 21D62 darwin-x64, locale en-GB) • Flutter version 3.22.0-27.0.pre.12 on channel master at /Users/dhs/documents/fluttersdk/flutter ! Warning: `flutter` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter. Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 0b3a88f218 (2 hours ago), 2024-05-07 22:42:36 -0400 • Engine revision 0a469aa59c • Dart version 3.5.0 (build 3.5.0-131.0.dev) • DevTools version 2.35.0 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/dhs/Library/Android/sdk ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13C100 • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 65.1.4 • Dart plugin version 213.7228 [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.29.0 [✓] Connected device (3 available) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 15.3.1 19D52 • macOS (desktop) • macos • darwin-x64 • macOS 12.2.1 21D62 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. [!] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer ! Flutter recommends a minimum Xcode version of 13. Download the latest version or update via the Mac App Store. • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.62.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (5 available) • SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30) • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios • iOS 14.4.1 18D61 • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. ```
William-Geng commented 6 months ago

in your PopScope, do this: onPopInvoked: (didPop) { if (didPop) return; context.pop(); },

chunhtai commented 4 months ago

need to wait for next stable release of flutter before fixing this

nicolasWenia commented 2 months ago

@chunhtai any updates on this? I'm still experiencing the issue with Flutter 3.24.1 and go_router 14.2.7