introduction_screen icon indicating copy to clipboard operation
introduction_screen copied to clipboard

Global introKey is called from different pages (routes)

Open Sadoun-Jr opened this issue 2 years ago • 1 comments

Good day, thank you for the amazing package, however I have a little problem.

I am putting buttons in my intro screen to navigate to different parts of the app, but when I am in one of those different parts, when I press back button, the Navigator goes to the page before the intro screen package is even used. my app is something like this: |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| .................................................................................................................../--> random page 3 --> xxx ................................................................/--> intro screen page 1| --> random page --> favs home --> introduction screen |--> intro screen page 2 --> random page 2 --> reviews ...............................................................--> intro screen page 3 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Now when I'm in page "favs" which is already 2 pages away from the intro screen, I navigate back to the "home". I am not using Navigator.pushReplacement anywhere in the app, just Navigator.of(context){...}

Also, the Global key used for navigation between different pages of the introduction_screen gets called when I preses back while in "favs" or "reviews" page.

Thanks for your time, I'd appreciate any help!

Sadoun-Jr avatar Jun 21 '22 23:06 Sadoun-Jr

Do this before your IntroductionScreen widget:


      WillPopScope(
        onWillPop: () async => false, // Block user from pressing back, disable back
        child:

alymbouras avatar Jul 12 '22 15:07 alymbouras

Hi @Sadoun-Jr

I'm presuming you found a solution and am closing this issue. Thanks for helping out @alymbouras

Many thanks, Gavin.

ghenry avatar Nov 23 '22 20:11 ghenry