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
7
votes
2 answers

Flutter drawer background image

I wonder if i can use background image instead of color in flutter app drawer header, Is there any way? I am able to customize he color but i am wonder if is there any property to alter the color with custom image.
7
votes
2 answers

flutter: How to not exit the app on back button press

The usual behaviour for the app is to exit, when back button is pressed. What I want is for the app to go to background without exiting, when back button is pressed. Just like what happens when we switch from one app to another. I know that it will…
Ayush Shekhar
  • 1,483
  • 4
  • 16
  • 32
7
votes
1 answer

Flutter - How to handle Navigation without using MaterialApp?

In flutter creating named routes is easy and logical, but only when returning a MaterialApp. class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { initialRoute: "/"; return MaterialApp( //gives…
Uncle Vector
  • 371
  • 1
  • 3
  • 12
6
votes
1 answer

Nested pages subroutes with go_router (Flutter)

My app structure can be like this: home/folder/:fid/player home/folder/:fid/folder/:fid/player home/folder/:fid/folder/:fid/folder/:fid/player with nested folders that can open other folders (a folder can contain an audio file which plays in the…
MSpeed
  • 8,153
  • 7
  • 49
  • 61
6
votes
1 answer

Flutter | How to know if widget is on top of navigation stack (visible)

In my Flutter app, I wish to pause an animation if a new page is pushed to the navigation stack. Question: From a widgets perspective, is there any way to know if the widget is at the top of the navigation stack? Example: while…
Vingtoft
  • 13,368
  • 23
  • 86
  • 135
6
votes
4 answers

Flutter - Navigate in PopupMenuButton onTap does not work

I used to use IconButton's onpressed to navigate to the settings page from my AppBar which worked. Now I am trying to trigger the navigation from a PopupMenuItem's onTap but the page does not navigate. Both widgets are in the same hierarchy and I…
finisinfinitatis
  • 861
  • 11
  • 23
6
votes
1 answer

Handle memory usage with images / videos and Navigators flutter

Sorry for the big post in advance... My app is a social network that behaves closely to Instagram. PATTERN : User profile (with list of thumbnails, no videos played) Select photo (open a page with Navigator.push() with photos / playing…
Tom3652
  • 2,540
  • 3
  • 19
  • 45
6
votes
1 answer

Flutter: How to disable Hero animations for a specific transition

Because I am reusing the same components in different contexts, unwanted Hero animations are displayed in the wrong transitions and my app is looking very glitchy. This is happening in a rather vanilla project, using MaterialApp and pushNamed for…
miguelSantirso
  • 1,243
  • 1
  • 12
  • 26
6
votes
1 answer

Flutter Web Navigation with persistent drawer and appbar

I'm having still no success with my Flutter Web App, doing an URL based routing and keeping things like the appbar and the drawer persistent. The goal I'm trying to achieve is, that I can only modify the content of my App. So i.e. if the user enters…
Aerofluxx
  • 61
  • 1
  • 6
6
votes
3 answers

What is the alternative to 'getApplicationContext()' in Android for Flutter

I want to create a generic public method navigate the application to login screen if any response is: unauthenticated. The problem is I don't have the context to use it in my Navigator. In Android I used to use: getApplicationContext(), how can I do…
Abdurrahman Anas
  • 665
  • 2
  • 9
  • 21
6
votes
4 answers

Dismiss keyboard on swipe back gesture in Flutter app

I am trying to dismiss the keyboard when the user swipes from the edge to pop route. Currently the keyboard doesn't dismiss until the route is completely gone popped, messing up some of the other pages layout until it dismisses I did try to use a…
tapizquent
  • 668
  • 11
  • 24
5
votes
1 answer

Get overlay without context

I need a reference to the current OverlayState from a service where I don't have access to the current context. I've tried to use the "trick" of getting my BuildContext from a navigator key, but while this works for dialogs and navigation, does not…
pitazzo
  • 1,125
  • 1
  • 13
  • 28
5
votes
3 answers

How to update screen A when navigating back from screen B with bloc flutter

I have a screen(A) which use 'AccountFetched' state to load list of data from database: return BlocProvider( create: (context) { return _accountBloc..add(FetchAccountEvent()); }, child: BlocBuilder
noyruto88
  • 767
  • 2
  • 18
  • 40
5
votes
2 answers

Object/factory with type NavigationService is not registered inside GetIt

This error keeps coming in my development Debug Console [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: 'package:get_it/get_it_impl.dart': Failed assertion: line 312 pos 7: 'instanceFactory != null': Object/factory with type…
Madhavan Swami
  • 121
  • 1
  • 6
5
votes
2 answers

Flutter, Navigator 2.0: How to return data from a screen?

Flutter, Navigator I want to return data from a new screen With old Navigator is very simple, use Navigator.push('new screen').then('process result') on base screen, and use Navigator.pop(result) on new…
atdima
  • 137
  • 1
  • 7
1 2
3
47 48