OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 import 'package:sky/widgets/basic.dart'; |
| 6 import 'package:sky/widgets/navigator.dart'; |
| 7 import 'package:sky/widgets/raised_button.dart'; |
| 8 |
| 9 List<Route> routes = [ |
| 10 new Route( |
| 11 name: 'main', |
| 12 builder: (navigator) => new RaisedButton( |
| 13 child: new Text('PRESS FORWARD'), |
| 14 onPressed: () => navigator.pushNamedRoute('secondary') |
| 15 ) |
| 16 ), |
| 17 new Route( |
| 18 name: 'secondary', |
| 19 builder: (navigator) => new RaisedButton( |
| 20 child: new Text('NO WAIT! GO BACK!'), |
| 21 onPressed: () => navigator.pushRoute(routes[0]) |
| 22 ) |
| 23 ) |
| 24 ]; |
| 25 |
| 26 class NavigationExampleApp extends App { |
| 27 UINode build() { |
| 28 return new Navigator(routes: routes); |
| 29 } |
| 30 } |
| 31 |
| 32 void main() { |
| 33 App app = new NavigationExampleApp(); |
| 34 } |
OLD | NEW |