Skip to content

Commit 43189d9

Browse files
authored
Rename Navigator 2.0 to Router (flutter#712)
* Rename Navigator 2.0 to Router This aligns better with the documentation for this new API, and doesn't imply that apps need to be upgraded. * introduction -> navigator
1 parent b6d9411 commit 43189d9

File tree

8 files changed

+18
-20
lines changed

8 files changed

+18
-20
lines changed

navigation_and_routing/README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
11
# Navigation and Routing sample code
22

33
Sample code for [Learning Flutter's New Navigation and Routing System][article],
4-
an article explaining Navigator 2.0.
4+
an article explaining the Router widget and it's associated classes.
55

66
## Samples
77

8-
**Navigator 1.0 samples**
8+
**Navigator samples**
99

10-
* [nav_1/anonymous_routes.dart](lib/nav_1/anonymous_routes.dart) - Shows how to
11-
use a Navigator to push and pop anonymous routes (e.g. MaterialPageRoute)
12-
* [nav_1/named_routes.dart](lib/nav_1/named_routes.dart) - Shows how to use
13-
define named routes via the `routes` parameter on MaterialApp, and navigate
14-
using Navigator.pushNamed
15-
* [nav_1/on_generate_route.dart](lib/nav_1/on_generate_route.dart) - Shows how
16-
to handle arbitrary named routes using the `onGenerateRoute` callback defined
17-
in the `MaterialApp` constructor.
10+
* [navigator/anonymous_routes.dart](lib/navigator/anonymous_routes.dart) -
11+
Shows how to use a Navigator to push and pop anonymous routes (e.g.
12+
MaterialPageRoute)
13+
* [navigator/named_routes.dart](lib/navigator/named_routes.dart) - Shows
14+
how to use define named routes via the `routes` parameter on MaterialApp, and
15+
navigate using Navigator.pushNamed
16+
* [navigator/on_generate_route.dart](lib/navigator/on_generate_route.dart) -
17+
Shows how to handle arbitrary named routes using the `onGenerateRoute`
18+
callback defined in the `MaterialApp` constructor.
1819

19-
**Navigator 2.0 samples**
20+
**Router samples**
2021

21-
* [nav_2/pages.dart](lib/nav_2/pages.dart) - Shows how to define a list of
22+
* [router/pages.dart](lib/router/pages.dart) - Shows how to define a list of
2223
[Page] objects on Navigator declaratively.
23-
* [nav_2/router.dart](lib/nav_2/router.dart) - Full sample that shows a custom
24+
* [router/router.dart](lib/router/router.dart) - Full sample that shows a custom
2425
RouteInformationParser and RouterDelegate parsing named routes and
2526
declaratively building the stack of pages for the Navigator.
2627

27-
2828
**Advanced**
2929

30-
* [nav_2_advanced/nested_router.dart](lib/nav_2_advanced/nested_router.dart) -
30+
* [router_advanced/nested_router.dart](lib/router_advanced/nested_router.dart) -
3131
Shows two [RouterDelegate], one nested within the other. A
3232
[BottomNavigationBar] can be used to select the route of the outer
3333
RouterDelegate, and additional routes can be pushed onto the inner
3434
RouterDelegate / Navigator.
35-
* [nav_2_advanced/transition_delegate.dart](lib/nav_2_advanced/transition_delegate.dart)
35+
* [router_advanced/transition_delegate.dart](lib/router_advanced/transition_delegate.dart)
3636
Shows how a custom TransitionDelegate can be used to customized when
3737
transition animations are shown.
3838

39-
4039
## Running
4140

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

4544
```bash
46-
flutter run lib/nav_2/router.dart
45+
flutter run lib/router/router.dart
4746
```
48-
4947
[article]: https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade

navigation_and_routing/lib/nav_1/anonymous_routes.dart renamed to navigation_and_routing/lib/navigator/anonymous_routes.dart

File renamed without changes.
File renamed without changes.

navigation_and_routing/lib/nav_1/on_generate_route.dart renamed to navigation_and_routing/lib/navigator/on_generate_route.dart

File renamed without changes.
File renamed without changes.
File renamed without changes.

navigation_and_routing/lib/nav_2_advanced/nested_router.dart renamed to navigation_and_routing/lib/router_advanced/nested_router.dart

File renamed without changes.

navigation_and_routing/lib/nav_2_advanced/transition_delegate.dart renamed to navigation_and_routing/lib/router_advanced/transition_delegate.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/// Shows how a custom TransitionDelegate can be used to customized when
66
/// transition animations are shown. (For example, [when two routes are popped
77
/// off the stack](https://github.com/flutter/flutter/issues/12146), however the
8-
/// default TransitionDelegate will handle this if you are using Navigator 2.0)
8+
/// default TransitionDelegate will handle this if you are using Router)
99
import 'package:flutter/material.dart';
1010

1111
void main() {

0 commit comments

Comments
 (0)