Chapter 7: Dismissing the Grocery Item screen

How does the app_router know to return to the “To Buy” tabs when the user clicks the back button after executing the following in _handlePopPage

if ( == FooderlichPages.groceryItemDetails) {

It seems like there’s no matching pages since selected_index != -1 and isCreatingNewItem == false.


@matan188 when state changes the navigator’s list of pages gets rebuild based on the new state. You can check out App_Router’s build() method.