syedmurtaza108 / chucker-flutter

An HTTP requests inspector inspired by Chucker Android
https://pub.dev/packages/chucker_flutter
MIT License
64 stars 34 forks source link

'package:flutter/src/widgets/navigator.dart': Failed assertion: line 3418 pos 14: 'observer.navigator == null': is not true. #46

Closed atharvabhagwat007 closed 2 weeks ago

atharvabhagwat007 commented 1 year ago

Describe the bug I am using auto route and Flutter Chucker navigator observer together. I am getting above issue. Following is my code part of './main.dart';

class App extends StatelessWidget { const App({super.key});

static final AppRouter appRouter = AppRouter( authenticationRouteGuard: AuthenticationRouteGuard(), );

// This widget is the root of your application. @override Widget build(final BuildContext context) => MaterialApp.router( title: 'title', debugShowCheckedModeBanner: false, routerDelegate: appRouter.delegate( navigatorObservers: () => [ ChuckerFlutter.navigatorObserver, MyObserver(), AutoRouteObserver(), ], ), routeInformationParser: appRouter.defaultRouteParser(), builder: ( final BuildContext context, final Widget? widget, ) => StreamChat( client: (Injector.resolve() as ChatClient).client, child: widget, ), ); }

arthuravilacompass commented 10 months ago

Got any update on this? I have a similar issue with GoRouter

shubhanus commented 4 months ago

any update or workaround on this?

ivangalkindeveloper commented 1 month ago

Solution - you must add the navigator observer to your router config Example for auto_route:

router.config(
        navigatorObservers: () => [
          ChuckerFlutter.navigatorObserver,
        ],
      );