Hello!! This article was really helpful! Thank you
But how did you handle it like Get.back()? An error occurs in this process. Same as Get.rootDelegate.popRoute().
I would ultimately like to implement the following elements.
Go back, go forward after refresh in a web browser. -> Success
Widgets that return to the previous page when the <- button is pressed (previously use Get.back())
Currently working on an open source project
: react-image-editor -> https://github.com/swimmingkiim/react-image-editor
You can support me
: https://www.buymeacoffee.com/swimmingkiim
You can do that by using Get.roodDelegate.popHistory with custom logic.
First, override popHistory method in AppRouterDelegate
classAppRouterDelegateextendsGetDelegate{GetNavConfiggetprevRoute=>// herehistory.length<2?history.last:history[history.length-2];@overrideFuture<GetNavConfig>popHistory()async{// and herefinalresult=prevRoute;Get.rootDelegate.offNamed(prevRoute.currentPage!.name);returnresult;}@overrideWidgetbuild(BuildContextcontext){returnNavigator(......);}}
And call it like this
Get.rootDelegate.popHistory();
I've tested it and it works for me. Hope this can help you :-)
Hello!! This article was really helpful! Thank you
But how did you handle it like
Get.back()? An error occurs in this process. Same asGet.rootDelegate.popRoute().I would ultimately like to implement the following elements.
<-button is pressed (previously useGet.back())Hello!
We can go back via html API, dart:html
Thanks!
HANW!
Helloo Buddies~
You can do that by using
Get.roodDelegate.popHistorywith custom logic.popHistorymethod inAppRouterDelegateI've tested it and it works for me. Hope this can help you :-)
Thank you!! That was really helpful
If you refresh it, it doesn't work
popHistory, but I think we can solve it in a different way!How you have implemented this? Even without overriding, getting same result.