Index: sky/examples/raw/navigation.dart |
diff --git a/sky/examples/raw/navigation.dart b/sky/examples/raw/navigation.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04f0144c7741cea04d6742b4797dd0cc6e82ac46 |
--- /dev/null |
+++ b/sky/examples/raw/navigation.dart |
@@ -0,0 +1,34 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+import 'package:sky/widgets/basic.dart'; |
+import 'package:sky/widgets/navigator.dart'; |
+import 'package:sky/widgets/raised_button.dart'; |
+ |
+List<Route> routes = [ |
+ new Route( |
+ name: 'main', |
+ builder: (navigator) => new RaisedButton( |
+ child: new Text('PRESS FORWARD'), |
+ onPressed: () => navigator.pushNamedRoute('secondary') |
+ ) |
+ ), |
+ new Route( |
+ name: 'secondary', |
+ builder: (navigator) => new RaisedButton( |
+ child: new Text('NO WAIT! GO BACK!'), |
+ onPressed: () => navigator.pushRoute(routes[0]) |
+ ) |
+ ) |
+]; |
+ |
+class NavigationExampleApp extends App { |
+ UINode build() { |
+ return new Navigator(routes: routes); |
+ } |
+} |
+ |
+void main() { |
+ App app = new NavigationExampleApp(); |
+} |