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 '../animation/animation.dart'; | 5 import '../animation/animation.dart'; |
6 import '../animation/curves.dart'; | 6 import '../animation/curves.dart'; |
7 import '../fn.dart'; | 7 import '../fn.dart'; |
8 import '../theme/colors.dart'; | 8 import '../theme/colors.dart'; |
9 import '../theme/shadows.dart'; | 9 import '../theme/shadows.dart'; |
10 import 'dart:async'; | 10 import 'dart:async'; |
(...skipping 16 matching lines...) Expand all Loading... |
27 value = -_kWidth; | 27 value = -_kWidth; |
28 } | 28 } |
29 | 29 |
30 void toggle(_) => _isMostlyClosed ? _open() : _close(); | 30 void toggle(_) => _isMostlyClosed ? _open() : _close(); |
31 | 31 |
32 void handleMaskTap(_) => _close(); | 32 void handleMaskTap(_) => _close(); |
33 | 33 |
34 void handlePointerDown(_) => stop(); | 34 void handlePointerDown(_) => stop(); |
35 | 35 |
36 void handlePointerMove(sky.PointerEvent event) { | 36 void handlePointerMove(sky.PointerEvent event) { |
37 assert(!isAnimating); | 37 if (isAnimating) |
| 38 return; |
38 value = math.min(0.0, math.max(value + event.dx, -_kWidth)); | 39 value = math.min(0.0, math.max(value + event.dx, -_kWidth)); |
39 } | 40 } |
40 | 41 |
41 void handlePointerUp(_) { | 42 void handlePointerUp(_) { |
42 if (!isAnimating) | 43 if (!isAnimating) |
43 _settle(); | 44 _settle(); |
44 } | 45 } |
45 | 46 |
46 void handlePointerCancel(_) { | 47 void handlePointerCancel(_) { |
47 if (!isAnimating) | 48 if (!isAnimating) |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 level: level | 162 level: level |
162 ); | 163 ); |
163 | 164 |
164 return new Container( | 165 return new Container( |
165 style: _style, | 166 style: _style, |
166 inlineStyle: inlineStyle, | 167 inlineStyle: inlineStyle, |
167 children: [ mask, content ] | 168 children: [ mask, content ] |
168 ); | 169 ); |
169 } | 170 } |
170 } | 171 } |
OLD | NEW |