| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:sky/base/lerp.dart'; | 5 import 'package:sky/base/lerp.dart'; |
| 6 import 'package:sky/painting/text_style.dart'; | 6 import 'package:sky/painting/text_style.dart'; |
| 7 import 'package:sky/theme/colors.dart'; | 7 import 'package:sky/theme/colors.dart'; |
| 8 import 'package:sky/widgets/basic.dart'; | 8 import 'package:sky/widgets/basic.dart'; |
| 9 import 'package:sky/widgets/card.dart'; | 9 import 'package:sky/widgets/card.dart'; |
| 10 import 'package:sky/widgets/dismissable.dart'; | 10 import 'package:sky/widgets/dismissable.dart'; |
| 11 import 'package:sky/widgets/scaffold.dart'; | 11 import 'package:sky/widgets/scaffold.dart'; |
| 12 import 'package:sky/widgets/variable_height_scrollable.dart'; | 12 import 'package:sky/widgets/variable_height_scrollable.dart'; |
| 13 import 'package:sky/widgets/theme.dart'; | 13 import 'package:sky/widgets/theme.dart'; |
| 14 import 'package:sky/widgets/tool_bar.dart'; | 14 import 'package:sky/widgets/tool_bar.dart'; |
| 15 import 'package:sky/widgets/widget.dart'; | 15 import 'package:sky/widgets/widget.dart'; |
| 16 import 'package:sky/theme/colors.dart' as colors; |
| 17 import 'package:sky/widgets/task_description.dart'; |
| 16 | 18 |
| 17 | 19 |
| 18 class CardCollectionApp extends App { | 20 class CardCollectionApp extends App { |
| 19 | 21 |
| 20 final TextStyle cardLabelStyle = | 22 final TextStyle cardLabelStyle = |
| 21 new TextStyle(color: white, fontSize: 18.0, fontWeight: bold); | 23 new TextStyle(color: white, fontSize: 18.0, fontWeight: bold); |
| 22 | 24 |
| 23 final List<double> cardHeights = [ | 25 final List<double> cardHeights = [ |
| 24 48.0, 64.0, 82.0, 46.0, 60.0, 55.0, 84.0, 96.0, 50.0, | 26 48.0, 64.0, 82.0, 46.0, 60.0, 55.0, 84.0, 96.0, 50.0, |
| 25 48.0, 64.0, 82.0, 46.0, 60.0, 55.0, 84.0, 96.0, 50.0, | 27 48.0, 64.0, 82.0, 46.0, 60.0, 55.0, 84.0, 96.0, 50.0, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 Widget build() { | 66 Widget build() { |
| 65 Widget cardCollection = new Container( | 67 Widget cardCollection = new Container( |
| 66 padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0), | 68 padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0), |
| 67 decoration: new BoxDecoration(backgroundColor: Theme.of(this).primarySwatc
h[50]), | 69 decoration: new BoxDecoration(backgroundColor: Theme.of(this).primarySwatc
h[50]), |
| 68 child: new VariableHeightScrollable( | 70 child: new VariableHeightScrollable( |
| 69 builder: _builder, | 71 builder: _builder, |
| 70 token: visibleCardIndices.length | 72 token: visibleCardIndices.length |
| 71 ) | 73 ) |
| 72 ); | 74 ); |
| 73 | 75 |
| 74 return new Scaffold( | 76 return new Theme( |
| 75 toolbar: new ToolBar(center: new Text('Swipe Away')), | 77 data: new ThemeData( |
| 76 body: cardCollection | 78 brightness: ThemeBrightness.light, |
| 79 primarySwatch: colors.Blue, |
| 80 accentColor: colors.RedAccent[200] |
| 81 ), |
| 82 child: new TaskDescription( |
| 83 label: 'Cards', |
| 84 child: new Scaffold( |
| 85 toolbar: new ToolBar(center: new Text('Swipe Away')), |
| 86 body: cardCollection |
| 87 ) |
| 88 ) |
| 77 ); | 89 ); |
| 78 } | 90 } |
| 79 } | 91 } |
| 80 | 92 |
| 81 void main() { | 93 void main() { |
| 82 runApp(new CardCollectionApp()); | 94 runApp(new CardCollectionApp()); |
| 83 } | 95 } |
| OLD | NEW |