Declarative Routing with GoRouter 5 (Flutter)

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • GoRouter is a declarative routing package for Flutter, and in this video, you'll learn how to use it with a simple step-by-step Flutter example.
    🚀 Learn Flutter / Build Apps 👇
    📖 Courses • www.atomsbox.com/courses
    ✍ Templates • www.atomsbox.com/templates
    🧑‍💻 Bespoke app dev • www.atomsbox.com/develop
    💾 GitHub • www.github.com/maxonflutter
    00:00 What is GoRouter?
    00:26 Boilerplate code walkthrough
    03:20 What are top-level routes and sub-routes in GoRouter?
    03:40 GoRouter: context.go vs context.push?
    04:50 Navigate across screens with paths and URLs
    06:30 Navigate across screens with GoRouter named routes
    08:10 What are GoRouter parameters and query parameters?
    15:05 What are GoRouter redirects and guards?
    This package uses the Flutter framework's Router API to provide a convenient, URL-based API for navigating between different screens. You can define URL patterns, navigate using a URL, handle deep links, and several other navigation-related scenarios.
  • НаукаНаука

Комментарии • 56

  • @MaxonFlutter
    @MaxonFlutter  4 месяца назад

    🚀Learn Flutter / Build Apps 👇
    📖📱Courses • www.atomsbox.com/courses
    ✍📱Templates • www.atomsbox.com/templates
    🧑‍💻📱Bespoke app dev • www.atomsbox.com/develop

  • @TreyHope
    @TreyHope 4 месяца назад

    I just started using Go Router for the first time, leaving GetX currently. This video was perfect for getting me setup on navigation. Thank you for sharing Max.

  • @sayyedaamerasharali7583
    @sayyedaamerasharali7583 10 месяцев назад

    This is very great. Thanks a lot.👍

  • @africaonegroup1810
    @africaonegroup1810 Год назад

    This is great, thank you!

  • @danielnovillo498
    @danielnovillo498 7 месяцев назад

    Thanks so much, you saved my life man

  • @aibor_io6871
    @aibor_io6871 2 месяца назад

    Hi Max, thank you for the tutorial, I just wanted to ask a question relating to your VS Code settings, how are you getting runtime errors to pop up on the editor like that, that is so convenient

  • @bilelmerseni1850
    @bilelmerseni1850 Год назад

    This is great, thank you! ♥♥♥♥♥

  • @Ivoire512
    @Ivoire512 7 месяцев назад

    well explained thanks

  • @unloo6241
    @unloo6241 Год назад

    I have already done this, it's working well but i need to let the user go to the register page which been added after the redirection, could you please help, i'm using almost the same code as you without the cubit because i have a function who handles it ty

  • @indomitablehumanspirit192
    @indomitablehumanspirit192 Год назад

    Help I don’t know how to use the app my dad bought all the plugin s how do u use the app??

  • @MaxonFlutter
    @MaxonFlutter  Год назад +3

    ❓How do you set up navigation and routing in your Flutter apps? Let me know in the comments ⬇

    • @devisubramaniyan6898
      @devisubramaniyan6898 Год назад

      Flutter Dating App - Models for User Match, Message and Chat - EP6 - The Dating App Series. hello sir i want this dating app source code can u pls me an and also i am ur subscriber

  • @user-dk1rw5uc3i
    @user-dk1rw5uc3i Год назад +1

    How can i rebuild page when i use context.go or context.pop ? I use provider but refersh is not working.

  • @herbertamukhuma
    @herbertamukhuma Год назад

    How are you able to use context.go method without getting the error: The method 'go' isn't defined for the class 'BuildContext'

    • @MaxonFlutter
      @MaxonFlutter  Год назад

      Have you importer go_router as a dependency in the file?

    • @herbertamukhuma
      @herbertamukhuma Год назад

      @@MaxonFlutter Done that, its working now, thanks

  • @keithbacalso9433
    @keithbacalso9433 Год назад +1

    also when do we know when to use params: ? and when to use queryParams: ? I got confuse by those 2

    • @dieg0503
      @dieg0503 11 месяцев назад

      Did you figure out when to use one or the other? Thanks!

  • @Kris-ff7hh
    @Kris-ff7hh Год назад

    How to return data on pop?

  • @bhattistudioentertainment
    @bhattistudioentertainment Год назад +1

    Brother please inform me about great platform through which I learn full flatter app development.I want to make chat and finance and crypto wallet apps can flutter do it.Please I hope I get answer please

    • @andreisas1621
      @andreisas1621 Год назад

      youtube is a good resource

    • @nested9301
      @nested9301 Год назад

      Flutter is bullshit man learn web dev and progressive web apps

    • @andreisas1621
      @andreisas1621 Год назад

      @@nested9301 it’s good for admin dashboards

  • @3kdevelopers185
    @3kdevelopers185 Год назад

    Sir how to remove all screens from stack (push named and remove until) in go router
    ❤ from PAKISTAN

  • @omprakashchauhan970
    @omprakashchauhan970 Год назад

    Routing doesn't work in production when i type manually in the address bar, also when i refresh its show me page not found but in debug mode works fine everything any idea what's the issue.
    You can check after deployment.

    • @MaxonFlutter
      @MaxonFlutter  Год назад

      Can you tell me more about your specific issue?

    • @omprakashchauhan970
      @omprakashchauhan970 Год назад

      @@MaxonFlutter Sure
      1.) Like when I add a Go router in Flutter Web App, after running in debug mode I can type manually the route name in the address bar it's working fine in debug, release, and profile mode in development time.
      2.) But when I Deployed my web app on Firebase, cloud anywhere live on the internet then I typed route name it show me page not found.
      I3.) don't see any specific solution related to these questions on the internet.

    • @MaxonFlutter
      @MaxonFlutter  Год назад

      @@omprakashchauhan970 I see, it should work fine on Flutter Web, too. I've deployed atomsbox.com and it uses GoRouter for navigation without any issue.

    • @MaxonFlutter
      @MaxonFlutter  Год назад

      Can you make an example with one of your routes, adding the GoRoute class that you have in your app, and as well the URL you're typing in the address bar.

    • @omprakashchauhan970
      @omprakashchauhan970 Год назад

      @@MaxonFlutter could you please share any web example any open source project it will help me a lot and many others 😊😊

  • @hasup2422
    @hasup2422 5 месяцев назад

    can you make an updated video

  • @rvb6516
    @rvb6516 Год назад

    24:26 your GoRouterRefreshStream seems more like a hack are you sure the is no better way ? :)

    • @MaxonFlutter
      @MaxonFlutter  Год назад

      Did you find any better solution? Any other approach to convert the bloc stream into a listenable would work.

  • @SaiyanJin85
    @SaiyanJin85 3 месяца назад

    What is cubit???

  • @mhddedekyansyah4720
    @mhddedekyansyah4720 Год назад

    Please make go router with bloc tutorial max

    • @MaxonFlutter
      @MaxonFlutter  Год назад

      I will release a new series of videos soon with an app build using the BLoC pattern and go router!

  • @renus584
    @renus584 Год назад

    How to check previous route ?

  • @emmyunng
    @emmyunng Год назад

    Please can you make a Slow movie app building with flutter .Because am A beginner

    • @MaxonFlutter
      @MaxonFlutter  Год назад

      Hi there! Have you watched the movie ui video I have prepared already ?

  • @youtubekids4985
    @youtubekids4985 Год назад

    bang github nya apa

  • @justflutter
    @justflutter Год назад +1

    context.go is not working in my case

  • @saidubundu6392
    @saidubundu6392 5 месяцев назад

    Flutter: App keeps going back to root route on hot reload

  • @keithbacalso9433
    @keithbacalso9433 Год назад

    please send github repo for this

  • @alaminegueye3218
    @alaminegueye3218 Год назад

    I've had for now a pretty bad experience with this package. For me, animation transitions are extremely important but they don't seem to work the right way with go_router

    • @programingtales7514
      @programingtales7514 11 месяцев назад

      Why?

    • @alaminegueye3218
      @alaminegueye3218 11 месяцев назад

      @@programingtales7514 Because it reloads your state everytime you navigate to your page, which is unconvenient for user experience
      And the animations are kinda weird but maybe it is bc i'm using bloc

  • @dartflutter3521
    @dartflutter3521 Год назад

    please write your github

  • @rest0rer611
    @rest0rer611 Год назад

    Hi, please, help me:
    I can't go back to the previous page if I navigated with onTap in inkwell or onTap in gesturedetector. only works with onpressed in button
    console:
    ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
    js_primitives.dart:30 The following assertion was thrown during a scheduler callback:
    js_primitives.dart:30 Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/embedder.dart:514:12
    js_primitives.dart:30 element.parentNode == _resourcesHost
    js_primitives.dart:30 is not true