Commit 927edaac authored by Hixie's avatar Hixie

Rename RouteState to StateRoute

...for consistency with the other Route subclasses:
```
  dialog.dart:      class DialogRoute extends Route
  drag_target.dart: class DragRoute extends Route
  navigator.dart:   class PageRoute extends Route
  navigator.dart:   class StateRoute extends Route
  popup_menu.dart:  class MenuRoute extends Route
```
parent fbd5460b
...@@ -123,8 +123,8 @@ class DrawerState extends State<Drawer> { ...@@ -123,8 +123,8 @@ class DrawerState extends State<Drawer> {
void _handleDismissed() { void _handleDismissed() {
if (config.navigator != null && if (config.navigator != null &&
config.navigator.currentRoute is RouteState && config.navigator.currentRoute is StateRoute &&
(config.navigator.currentRoute as RouteState).owner == this) // TODO(ianh): remove cast once analyzer is cleverer (config.navigator.currentRoute as StateRoute).owner == this) // TODO(ianh): remove cast once analyzer is cleverer
config.navigator.pop(); config.navigator.pop();
if (config.onDismissed != null) if (config.onDismissed != null)
config.onDismissed(); config.onDismissed();
......
...@@ -10,7 +10,7 @@ import 'package:sky/src/widgets/transitions.dart'; ...@@ -10,7 +10,7 @@ import 'package:sky/src/widgets/transitions.dart';
typedef Widget RouteBuilder(NavigatorState navigator, Route route); typedef Widget RouteBuilder(NavigatorState navigator, Route route);
typedef RouteBuilder RouteGenerator(String name); typedef RouteBuilder RouteGenerator(String name);
typedef void RouteStateCallback(RouteState route); typedef void StateRouteCallback(StateRoute route);
typedef void NotificationCallback(); typedef void NotificationCallback();
class Navigator extends StatefulComponent { class Navigator extends StatefulComponent {
...@@ -48,7 +48,7 @@ class NavigatorState extends State<Navigator> { ...@@ -48,7 +48,7 @@ class NavigatorState extends State<Navigator> {
} }
void pushState(State owner, Function callback) { void pushState(State owner, Function callback) {
push(new RouteState( push(new StateRoute(
route: currentRoute, route: currentRoute,
owner: owner, owner: owner,
callback: callback callback: callback
...@@ -275,12 +275,12 @@ class PageRoute extends Route { ...@@ -275,12 +275,12 @@ class PageRoute extends Route {
} }
} }
class RouteState extends Route { class StateRoute extends Route {
RouteState({ this.route, this.owner, this.callback }); StateRoute({ this.route, this.owner, this.callback });
Route route; Route route;
State owner; State owner;
RouteStateCallback callback; StateRouteCallback callback;
bool get hasContent => false; bool get hasContent => false;
bool get modal => false; bool get modal => false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment