I am using the go_router in my app and also the get package. The problem is that since I implemented the Go-Router
I can no longer show the Get.snackbar
. It is failing and throwing a null-error
.
For the GoRouter
to work I had to add the .router
for my GetMaterialApp
. And then navigationKey
was no longer available so I tried it with only key
.
This is my GetMaterialApp
:
child: GetMaterialApp.router(
title: 'Wishlists',
key: Get.key, // <- I think that this might cause the issue
routeInformationProvider: router.routeInformationProvider,
routeInformationParser: router.routeInformationParser,
routerDelegate: router.routerDelegate,
translationsKeys: AppTranslation.translationsKeys,
locale: locale,
fallbackLocale: fallbackLocale,
),
This is the error
:
Error: Unexpected null value. at Object.throw_ [as throw] (http://localhost:51492/dart_sdk.js:5080:11) at Object.nullCheck (http://localhost:51492/dart_sdk.js:5399:30) at [_configureOverlay] (http://localhost:51492/packages/get/get_navigation/src/snackbar/snackbar_controller.dart.lib.js:2970:53) at [_show] (http://localhost:51492/packages/get/get_navigation/src/snackbar/snackbar_controller.dart.lib.js:3113:30)
I feel like it has something to do with the key
inside the GetMaterialApp
, but I have no idea how to solve this.
Is this a known bug? What am I missing here?