DEV Community

Discussion on: Flutter Web - Fix Refresh & Back button Problem

Collapse
 
disterbia profile image
disterbia

when i did it your way on the flutter web, Get.rootDelegate.toNamed("/") works, but Get.rootDelegate.offToNamed("/") throws an Unexpected null value error. I think there is an error related to the key, but I can't figure it out.
Also Get.snackbar() throws the same error.

Collapse
 
8138976373 profile image
Safvan Puthalath

class AppRouterDelegate extends GetDelegate {
@override
Widget build(BuildContext context) {
return Navigator(
key: Get.key, //Please add this line to get snackbar,dialog,etc.
onPopPage: (route, result) => route.didPop(result),
pages: currentConfiguration != null
? [currentConfiguration!.currentPage!]
: [GetNavConfig.fromRoute(Routes.HOME)!.currentPage!],
);
}
}

Collapse
 
disterbia profile image
disterbia
Collapse
 
verrelravanelli profile image
verrelravanelli

Hey, i tried to open your stackoverflow link but its say already removed. Do you already find the solution for this problem? Thanks