How to Build a Bottom Navigation Bar with Nested Routes Using Flutter Go Router

preview_player
Показать описание
Learn how to implement a sleek bottom navigation bar with nested routes in your Flutter app using the Go Router package.

This tutorial covers:
- Setting up Go Router in your project
- Creating a bottom navigation bar layout
- Implementing nested routes for each tab
- Handling navigation state and deep linking

Perfect for Flutter developers looking to enhance their app's navigation structure. Code along to build a professional, scalable navigation system in just a few minutes!

Timeline
00:00 Intro
00:06 Installing Go Router
00:10 Creating the Go Router Instance
00:26 Using the StatefulShellRoute
00:58 Creating the Layout Scaffold
01:22 Adding the Bottom Navigation Bar
02:05 Adding the Branches to the Router
02:32 Initializing the Go Router instance
02:51 Adding a Nested Shell Route
03:42 Passing Data to a Nested Shell Route

Need an App or Website?

Also Checkout :
Рекомендации по теме
Комментарии
Автор

Honestly, it’s almost impressive how they managed to turn it into a Schrödinger’s package—both broken and not broken at the same time! Truly a masterclass in chaos. Bravo!

tutorial
Автор

I was searching for this solution my whole life !

ramzibouhadjar
Автор

Great tutorial! Sorry, but I can't resist smiling every time you say Navigation Destination. It sounds like the antartar-tart-ica guy. 😂

NinjaTxGaming
Автор

Amazing tutorial as at time it's needed

adebayowemimo
Автор

There is usually a scenario where on click of an item in the list page, you need to do to the detail page. That detail page is shown without the bottom navigation bar. For example: On click of a user in linkedin. How to implement that.

Please note: We can share that link and on press of that, the url/route directly opens. I am not asking you to implement app links here, but the architecture can be done with that in mind.

A good solution of this will really help your followers

dhrubajyotirakshit
Автор

Thank you amazing tutorial. I use Getx in my application when I use nested page and hot releoad forget last position. I will try go router 😅

Автор

Thank you for the explanation!

I have a question regarding state management with nested pages:

Let's say I navigate deep into a series of pages within a tab on the BottomNavigationBar. When I switch to another tab and then return to the original tab where I navigated deeply, will I see the last page I reached within that tab, or will it reset to the initial page of that tab?

MoayadAlKadry
Автор

could you make it please with persistent_bottom_nav_bar
please your explain is awesome

I search a lot and don't found any one explain routing as your perfect

can you explain it fastly

and awesome videos keep going
❤‍🔥

mahmoudetman
Автор

So I created a similar solution here but my problem is that my application has a scan page, and a help page. I set both of those at the bottom toolbar. There are several pages that load after scanning something. Lets say I scan something that contains plastic well it scans it just fine but when I click on the scanning icon It stays in the plastic page and doesn't reload scan page. The plastic page is nested at the bottom of the scan page. Any thoughts?

JaysonFlores-dp
Автор

How do we embed a conditional homepage here - if a user is logged in it’s a different screen

berkcancinar
Автор

Can you have a solution, when you stay in a subpage, re-press the button nav, to go back to the first page (parent page)?

tmyker
Автор

I have a question. How to add popScope on go router's bottom navigation? I have wrapped the bottom navigation widget wit popScope but its not working.

rohanstha
Автор

we need a solution how to do redirect for authentication, please do video on it

rebazjabar
Автор

I have a question. How can we add a different type of transition between the nav bar screen? i am stuck in this situation with go_route. Can you please make a tutorial on it?

smartcoder
Автор

Init state will not work when navigating for the second time .

safwanjmuhammed
Автор

Hi, nice tutorial but I have a case
if I want a more button to nav home page, it not work
static const String homePage = '/home';
static const String explorePage = '/explore';
static const String settingsPage = '/settings';
static const String profilePage = 'profile';
static const String nestedProfilePage = '/settings/profile';
static const String nestedHomePage = '/settings/home';
StatefulShellBranch(
routes: [
GoRoute(
path: Routes.settingsPage,
builder: (context, state) => const SettingsPage(),
routes: [
GoRoute(
path: Routes.profilePage,
builder: (context, state) => ProfilePage(
user: state.extra as User,
)),
GoRoute(
path: Routes.homePage,
builder: (context, state) => HomePage(),
),
],
),
],
),
I throw a exception,
' package : go_router/ src/
Failed
configuration. dart' :
assertion: line 43 pos 18:
route.path.startsWith('/') && I
route. path. endsWith( ' / ')' :
sub-
route path may not start or end
with "/" : GoRoute#6a5ed(name:
"Home", path: "/home")
See also: https://
docs. flutter. dev/testing/errors

tmyker
Автор

this is what i hate from you.. why don't you show the file

toptrainers
Автор

idon't know if you are aware of this but your website very janky and even simple navigation is so slow

nested
Автор

no to go router, be with framework one

manishgautam
welcome to shbcf.ru