qlevar_router
qlevar_router copied to clipboard
Force refresh issue when using alongside canPopFunc
Hi There, Thanks for the awesome package. It makes our life much easier. I am currently facing a issue with navigation. My homepage route is at "/" and I have added back button check using canPopFunc() like below.
`QRoute( name: homePage,
path: '/',
builder: () => HomePage(),
middleware: [
QMiddlewareBuilder(
redirectGuardFunc: (s) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
int? initScreen = await prefs.getInt("initScreen");
return initScreen == null ? '/onboarding' : null;
},
canPopFunc: () async {
AlertDialog dialog(BuildContext context) => ......//some code here
final result = await showDialog<bool>(
context: QR.context!, builder: dialog);
return result ?? false;
},
)
],
),`
Now whenever I am trying to force refresh the page or probably do pushReplacement using QR.navigator.replaceLast('/');
the exit alert dialog in being triggered. Any way to stop this?