Questions tagged [flutter-navigation]

For questions relating to navigation methods in Flutter, like the Navigator class. Use this tag in combination with the general [flutter] tag. If your question applies to Flutter more generally, use the [flutter] tag only.

Flutter allows cross-platform development targeting both iOS and Android from a single code base. Flutter contains modules to implement navigation for mobile applications.

710 questions
4
votes
1 answer

Web control browser back button

I'm using Navigation 2 and setUrlStrategy(PathUrlStrategy()); I added WillPopScope but the onWillPop is not called when clicking the browser's back button. Widget build(context) { return WillPopScope( onWillPop: () async { print('here'); …
Rony Tesler
  • 1,207
  • 15
  • 25
4
votes
2 answers

How to navigate to screen and remove all screen/route history [sign out functionality]

How can i navigate to a screen and remove all previous routing history so that the user cannot press back and get to the previous screen? In my case I want to push the login screen when a user is logged out, but the navigation history is still there…
Joel Broström
  • 3,530
  • 1
  • 34
  • 61
4
votes
4 answers

Navigation problem with FutureBuilder and MaterialApp

My app has a state which is computed as a Future. For example it includes a theme color, because I want to change the color when I navigate. I try to display a progress indicator while waiting for the data. But I can't make it work. Either…
Patrick
  • 3,578
  • 5
  • 31
  • 53
4
votes
1 answer

Flutter : Keyboard pops up after Dialog is destroyed

Problem : When login button is pressed, a progress indicator is shown. But, when it's done, keyboard automatically pops up even if it was not showing eariler. What I think : I think that because the last focus was on TextField, the current focus is…
Detained Developer
  • 1,134
  • 2
  • 13
  • 33
4
votes
1 answer

Routes returning null while calling popUntil on GlobalKey

I am using global key to handle my navigations. The main.dart, routes and NavigationService are as below. The main purpose of using the global keys is to make the navigation independent of context so that the network modules can auto log user out…
mr_sh
  • 304
  • 1
  • 10
4
votes
1 answer

Flutter webapp redirects to homepage

I've created single page webapp (Not connected to database, currently using hardcoded dummy data) when I deploy it on independent server it works fine (i.e www.example.com) but when I deploy it as a sub-app (www.example.com/flutter) it redirects to…
akshay bhange
  • 2,320
  • 2
  • 28
  • 46
4
votes
1 answer

Physical back button not working in Flutter, I can't even exit the app

I have no clue why this is happening. When device or emulator back button is pressed, nothing happens. App bar back button is working!, implemented back button works also. I've created a new flutter project to test this problem: First…
Omar Fayad
  • 1,733
  • 3
  • 11
  • 27
4
votes
3 answers

Flutter Navigator.pushReplacementNamed show back button at the page

I'm using Navigator.pushReplacementNamed in flutter app to navigate from loginpage to homepage working well, but in my homepage show back arrow button at the appBar and it returns to loginpage when pressing it. What should I do? I tried put leading:…
4
votes
2 answers

Navigator.push() vs Navigator.pushNamed() when passing data to screen

I would like to pass data to another screen. According to the docs when using named routes I need to use Arguments and use: Navigator.pushNamed( context, NextScreen.route, arguments: NextScreenArgs("pew"), ); However the same(?) could be…
yN.
  • 1,847
  • 5
  • 30
  • 47
4
votes
2 answers

Unable to access Provider in new page route Widget

I am unable to access the Provider in a Widget that I pushed onto the current Navigator: import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; import 'package:provider/provider.dart'; void main() =>…
user2233706
  • 6,148
  • 5
  • 44
  • 86
4
votes
4 answers

Flutter - How to get notified when the page I pushed was popped by back button?

Assume this scenario: page1 Navigator.push to page2. user on page2 clicks the back button, so page2 pops and page1 regains view. How do I catch this event on page1?
shaharsol
  • 991
  • 2
  • 10
  • 31
4
votes
2 answers

top TabBar inside BottomNavigationBar

I'm having trouble getting a top TabBar to render inside my BottomNavigationBar. I only want the top TabBar to be displayed inside the home BottomNavigationBarItem. I know I can setup another scaffold in the home page, but I obviously don't want a…
jacob blankenship
  • 145
  • 1
  • 3
  • 16
4
votes
0 answers

How to reset the navigator when switching between cupertino tabs

I'm trying to setup a multipage app in Flutter, where the bottom tabbar contains the four most used pages, including a "More" button. The more button shows a page with links to other pages. When clicking on a page, I want this page to replace the…
Thomas Roovers
  • 116
  • 2
  • 9
4
votes
1 answer

Flutter pass argument directly with named routes navigation

I have been looking at all the answers on here to pass arguments when doing named route navigation but they seem to be old answers or they don't work. From what was written it should be working but it doesn't seem to do anything, so I am not sure…
Nicholas Muir
  • 2,897
  • 8
  • 39
  • 89
4
votes
1 answer

Cannot install a MaterialPageRoute after disposing it

The setup I have to simple routes, FirstRoute and SecondRoute. Each one contains a button to for the navigation. Pressing FirstRoute's button leads to second and vice-versa. The exception I am getting an exception when I am trying to navigate from…
Themelis
  • 4,048
  • 2
  • 21
  • 45