1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00
Files
samples/navigation_and_routing
2021-03-17 11:46:59 +11:00
..
2020-12-11 17:27:01 -08:00
2020-12-11 17:27:01 -08:00
2021-02-11 08:59:55 -08:00
2020-12-11 17:27:01 -08:00
2020-12-11 17:27:01 -08:00
2021-03-17 11:46:59 +11:00

Navigation and Routing sample code

Sample code for Learning Flutter's New Navigation and Routing System, an article explaining the Router widget and its associated classes.

Samples

Navigator samples

Router samples

  • router/pages.dart - Shows how to define a list of [Page] objects on Navigator declaratively.
  • router/router.dart - Full sample that shows a custom RouteInformationParser and RouterDelegate parsing named routes and declaratively building the stack of pages for the Navigator.

Advanced

  • router_advanced/nested_router.dart - Shows two [RouterDelegate], one nested within the other. A [BottomNavigationBar] can be used to select the route of the outer RouterDelegate, and additional routes can be pushed onto the inner RouterDelegate / Navigator.
  • router_advanced/transition_delegate.dart Shows how a custom TransitionDelegate can be used to customize when transition animations are shown.

Running

Each file in this project is an entrypoint. To run, specify the filename of the sample:

flutter run lib/router/router.dart