From df2711620f9723e2568b2f70a90b7680d0bddf23 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 15 Jul 2015 16:31:24 -0700 Subject: [PATCH] Add Cards and Fitness demos, remove sector. The launch cards still need to be made nicer. R=abarth@chromium.org, abarth@google.com Review URL: https://codereview.chromium.org/1232103006 . --- sdk/example/demo_launcher/lib/main.dart | 36 ++++++++++++++---------- sdk/example/fitness/lib/main.dart | 8 ++++-- sdk/example/widgets/BUILD.gn | 7 ++++- sdk/example/widgets/card_collection.dart | 18 ++++++++++-- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/sdk/example/demo_launcher/lib/main.dart b/sdk/example/demo_launcher/lib/main.dart index 70d70a796..c8cfed8c8 100644 --- a/sdk/example/demo_launcher/lib/main.dart +++ b/sdk/example/demo_launcher/lib/main.dart @@ -90,27 +90,33 @@ List demos = [ ) ), new SkyDemo( - name: 'Interactive Flex', - href: '../../rendering/interactive_flex.dart', - bundle: 'interactive_flex.skyx', - description: 'Swipe to adjust the layout of the app', + name: 'Fitness', + href: '../../fitness/lib/main.dart', + bundle: 'fitness.skyx', + description: 'Collin should write a nice description', textTheme: typography.white, decoration: new BoxDecoration( backgroundColor: const Color(0xFF0081C6) ) ), new SkyDemo( - name: 'Sector', - href: '../../widgets/sector.dart', - bundle: 'sector.skyx', - description: 'Demo of alternative layouts', - textTheme: typography.black, + name: 'Cards', + href: '../../widgets/card_collection.dart', + bundle: 'cards.skyx', + description: 'Demo of interactive Cards', + textTheme: typography.white, decoration: new BoxDecoration( - backgroundColor: colors.black, - backgroundImage: new BackgroundImage( - image: _bundle.loadImage('assets/sector_thumbnail.png'), - fit: BackgroundFit.cover - ) + backgroundColor: const Color(0xFF0081C6) + ) + ), + new SkyDemo( + name: 'Interactive Text', + href: '../../rendering/interactive_flex.dart', + bundle: 'interactive_flex.skyx', + description: 'Swipe to reflow the app', + textTheme: typography.white, + decoration: new BoxDecoration( + backgroundColor: const Color(0xFF0081C6) ) ), // new SkyDemo( @@ -178,7 +184,7 @@ class SkyHome extends App { Widget build() { return new Theme( data: new ThemeData( - brightness: ThemeBrightness.dark, + brightness: ThemeBrightness.light, primarySwatch: colors.Teal ), child: new TaskDescription( diff --git a/sdk/example/fitness/lib/main.dart b/sdk/example/fitness/lib/main.dart index f407a086e..7712fed29 100644 --- a/sdk/example/fitness/lib/main.dart +++ b/sdk/example/fitness/lib/main.dart @@ -7,6 +7,7 @@ import 'package:sky/widgets/basic.dart'; import 'package:sky/widgets/navigator.dart'; import 'package:sky/widgets/theme.dart'; import 'package:sky/widgets/widget.dart'; +import 'package:sky/widgets/task_description.dart'; import 'measurement.dart'; import 'home.dart'; @@ -20,7 +21,7 @@ class FitnessApp extends App { void initState() { _navigationState = new NavigationState([ new Route( - name: '/', + name: '/', builder: (navigator, route) => new HomeFragment(navigator, _userData) ), new Route( @@ -61,7 +62,10 @@ class FitnessApp extends App { primarySwatch: colors.Indigo, accentColor: colors.PinkAccent[200] ), - child: new Navigator(_navigationState) + child: new TaskDescription( + label: 'Fitness', + child: new Navigator(_navigationState) + ) ); } } diff --git a/sdk/example/widgets/BUILD.gn b/sdk/example/widgets/BUILD.gn index 299ad5b52..2de2c054f 100644 --- a/sdk/example/widgets/BUILD.gn +++ b/sdk/example/widgets/BUILD.gn @@ -12,11 +12,16 @@ skyx("piano") { main_dart = "piano.dart" } +skyx("cards") { + main_dart = "card_collection.dart" +} + group("widgets") { testonly = true deps = [ - ":sector", + ":cards", ":piano", + ":sector", ] } diff --git a/sdk/example/widgets/card_collection.dart b/sdk/example/widgets/card_collection.dart index 6f9f22297..a53369d68 100644 --- a/sdk/example/widgets/card_collection.dart +++ b/sdk/example/widgets/card_collection.dart @@ -13,6 +13,8 @@ import 'package:sky/widgets/variable_height_scrollable.dart'; import 'package:sky/widgets/theme.dart'; import 'package:sky/widgets/tool_bar.dart'; import 'package:sky/widgets/widget.dart'; +import 'package:sky/theme/colors.dart' as colors; +import 'package:sky/widgets/task_description.dart'; class CardCollectionApp extends App { @@ -71,9 +73,19 @@ class CardCollectionApp extends App { ) ); - return new Scaffold( - toolbar: new ToolBar(center: new Text('Swipe Away')), - body: cardCollection + return new Theme( + data: new ThemeData( + brightness: ThemeBrightness.light, + primarySwatch: colors.Blue, + accentColor: colors.RedAccent[200] + ), + child: new TaskDescription( + label: 'Cards', + child: new Scaffold( + toolbar: new ToolBar(center: new Text('Swipe Away')), + body: cardCollection + ) + ) ); } } -- GitLab