-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Physical Back button closes the application #82
Comments
HI there 👋🏼 May you share with us a minimal reproduction sample? |
I pushed a minimal reproduction sample here. I'm really sorry if i did something wrong and easily fixable but I'm not very proficient with this library yet. |
Any update? 🥲 |
Hi @francescovallone 👋 |
HI there @francescovallone ! Forgive us for getting back to you so late ! At first glance, it seems that you are seeking to use flow builder once a user is already logged in, and this example was a simplified use case for it ! Although, because it's oversimplified I believe this caused you problems. I'd highly suggest you model your application like this example here This practice of using an enum for a status to drive the state is consistent with almost every example we have, and it may resolve the issues here. Give this a try - instead of using a string, use a status with an enum to route. |
Hi @Gene-Dana! I actually did some tests in the meantime and I found out that you should return in the onGeneratePages an list of the pages that you want to load up. In fact I tried to rewrite the function as following. And I used an enum too 😄. List<Page> onGeneratePages(
RouterStatus status,
List<Page<dynamic>> pages,
){
switch(status){
case RouterStatus.monster:
return [MainPage.page(), MonstersListPage.page(), MonsterPage.page()]
case RouterStatus.monstersList:
return [MainPage.page(), MonstersListPage.page()]
default:
return [MainPage.page()]
}
} If you write it this way it actually lets you use the physical button to go back, otherwise it will not have any page in the list and it will close the application. Sorry if I not kept this issue updated but I also had a lot to do in these days 🤕 |
Describe the bug
Using the physical back button it closes the application instead of going back to the previous screen.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should go back to the previous page
Screenshots
![](https://user-images.githubusercontent.com/15020233/154586975-bd0f2bec-f092-4e0f-a8d1-52d584df94b1.png)
![](https://user-images.githubusercontent.com/15020233/154586981-e9c545f3-acb2-438d-accb-b0c5c8f3e3de.jpg)
**Logs **
The text was updated successfully, but these errors were encountered: