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

Unified Diff: sky/examples/widgets/navigation.dart

Issue 1218593002: Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
Index: sky/examples/widgets/navigation.dart
diff --git a/sky/examples/widgets/navigation.dart b/sky/examples/widgets/navigation.dart
deleted file mode 100644
index 82a9b35bbc7c0ccbe1eb536e8bb017aac1588011..0000000000000000000000000000000000000000
--- a/sky/examples/widgets/navigation.dart
+++ /dev/null
@@ -1,72 +0,0 @@
-// 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: 'home',
- builder: (navigator, route) => new Container(
- padding: const EdgeDims.all(20.0),
- decoration: new BoxDecoration(backgroundColor: const Color(0xFFCCCCCC)),
- child: new Block([
- new Text("You are at home"),
- new RaisedButton(
- child: new Text('GO SHOPPING'),
- onPressed: () => navigator.pushNamed('shopping')
- ),
- new RaisedButton(
- child: new Text('START ADVENTURE'),
- onPressed: () => navigator.pushNamed('adventure')
- )
- ])
- )
- ),
- new Route(
- name: 'shopping',
- builder: (navigator, route) => new Container(
- padding: const EdgeDims.all(20.0),
- decoration: new BoxDecoration(backgroundColor: const Color(0xFFBF5FFF)),
- child: new Block([
- new Text("Village Shop"),
- new RaisedButton(
- child: new Text('RETURN HOME'),
- onPressed: () => navigator.pop()
- ),
- new RaisedButton(
- child: new Text('GO TO DUNGEON'),
- onPressed: () => navigator.push(routes[2])
- )
- ])
- )
- ),
- new Route(
- name: 'adventure',
- builder: (navigator, route) => new Container(
- padding: const EdgeDims.all(20.0),
- decoration: new BoxDecoration(backgroundColor: const Color(0xFFDC143C)),
- child: new Block([
- new Text("Monster's Lair"),
- new RaisedButton(
- child: new Text('NO WAIT! GO BACK!'),
- onPressed: () => navigator.pop()
- )
- ])
- )
- )
-];
-
-class NavigationExampleApp extends App {
- NavigationState _navState = new NavigationState(routes);
-
- Widget build() {
- return new Flex([new Navigator(_navState)]);
- }
-}
-
-void main() {
- runApp(new NavigationExampleApp());
-}

Powered by Google App Engine
This is Rietveld 408576698