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

Side by Side Diff: sky/framework/components/drawer.dart

Issue 1027813002: Introduce Scaffold to Sky framework (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 'animated_component.dart'; 5 import 'animated_component.dart';
6 import '../animation/animated_value.dart'; 6 import '../animation/animated_value.dart';
7 import '../animation/curves.dart'; 7 import '../animation/curves.dart';
8 import '../fn.dart'; 8 import '../fn.dart';
9 import '../theme/colors.dart'; 9 import '../theme/colors.dart';
10 import '../theme/shadows.dart'; 10 import '../theme/shadows.dart';
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 double targetPosition = direction < 0.0 ? -_kWidth : 0.0; 70 double targetPosition = direction < 0.0 ? -_kWidth : 0.0;
71 double distance = (targetPosition - position.value).abs(); 71 double distance = (targetPosition - position.value).abs();
72 double duration = distance / velocityX; 72 double duration = distance / velocityX;
73 73
74 position.animateTo(targetPosition, duration, curve: linear); 74 position.animateTo(targetPosition, duration, curve: linear);
75 } 75 }
76 } 76 }
77 77
78 class Drawer extends AnimatedComponent { 78 class Drawer extends AnimatedComponent {
79 // TODO(abarth): We need a better way to become a container for absolutely
80 // positioned elements.
79 static final Style _style = new Style(''' 81 static final Style _style = new Style('''
80 position: absolute; 82 transform: translateX(0);''');
81 top: 0;
82 left: 0;
83 bottom: 0;
84 right: 0;'''
85 );
86 83
87 static final Style _maskStyle = new Style(''' 84 static final Style _maskStyle = new Style('''
88 background-color: black; 85 background-color: black;
89 will-change: opacity; 86 will-change: opacity;
90 position: absolute; 87 position: absolute;
91 top: 0; 88 top: 0;
92 left: 0; 89 left: 0;
93 bottom: 0; 90 bottom: 0;
94 right: 0;''' 91 right: 0;'''
95 ); 92 );
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 inlineStyle: inlineStyle, 146 inlineStyle: inlineStyle,
150 children: [ mask, content ] 147 children: [ mask, content ]
151 ), 148 ),
152 onPointerDown: controller.handlePointerDown, 149 onPointerDown: controller.handlePointerDown,
153 onPointerMove: controller.handlePointerMove, 150 onPointerMove: controller.handlePointerMove,
154 onPointerUp: controller.handlePointerUp, 151 onPointerUp: controller.handlePointerUp,
155 onPointerCancel: controller.handlePointerCancel 152 onPointerCancel: controller.handlePointerCancel
156 ); 153 );
157 } 154 }
158 } 155 }
OLDNEW
« no previous file with comments | « sky/examples/stocks-fn/lib/stock_app.dart ('k') | sky/framework/components/floating_action_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698