Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: sky/sdk/lib/widgets/navigator.dart

Issue 1231753008: Support for anonymous state routes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: re-upload Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/widgets/drawer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/navigator.dart
diff --git a/sky/sdk/lib/widgets/navigator.dart b/sky/sdk/lib/widgets/navigator.dart
index 33bfc58e75037949c3297d60438a2c8874088fe5..483325f4747b200d35049245ab6d598087424b18 100644
--- a/sky/sdk/lib/widgets/navigator.dart
+++ b/sky/sdk/lib/widgets/navigator.dart
@@ -7,21 +7,22 @@ import 'package:sky/widgets/basic.dart';
typedef Widget Builder(Navigator navigator, RouteBase route);
abstract class RouteBase {
- RouteBase({ this.name });
- final String name;
+ RouteBase({ this.key });
+ final Object key;
Widget build(Navigator navigator, RouteBase route);
void popState() { }
}
class Route extends RouteBase {
- Route({ String name, this.builder }) : super(name: name);
+ Route({ String name, this.builder }) : super(key: name);
+ String get name => key;
final Builder builder;
Widget build(Navigator navigator, RouteBase route) => builder(navigator, route);
}
class RouteState extends RouteBase {
- RouteState({this.callback, this.route, String name}) : super(name: name);
+ RouteState({ this.callback, this.route, Object key }) : super(key: key);
RouteBase route;
Function callback;
@@ -86,9 +87,9 @@ class Navigator extends StatefulComponent {
RouteBase get currentRoute => state.currentRoute;
- void pushState(String name, Function callback) {
+ void pushState(Object key, Function callback) {
RouteBase route = new RouteState(
- name: name,
+ key: key,
callback: callback,
route: state.currentRoute
);
« no previous file with comments | « sky/sdk/lib/widgets/drawer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698