| 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'; |
| 11 import 'dart:math' as math; | 11 import 'dart:math' as math; |
| 12 import 'dart:sky' as sky; | 12 import 'dart:sky' as sky; |
| 13 import 'material.dart'; | 13 import 'material.dart'; |
| 14 | 14 |
| 15 const double _kWidth = 304.0; | 15 const double _kWidth = 304.0; |
| 16 const double _kMinFlingVelocity = 0.4; | 16 const double _kMinFlingVelocity = 0.4; |
| 17 const double _kBaseSettleDurationMS = 246.0; | 17 const double _kBaseSettleDurationMS = 246.0; |
| 18 const double _kMaxSettleDurationMS = 600.0; | 18 const double _kMaxSettleDurationMS = 600.0; |
| 19 const Cubic _kAnimationCurve = parabolicRise; | 19 const Curve _kAnimationCurve = parabolicRise; |
| 20 | 20 |
| 21 class DrawerAnimation extends Animation { | 21 class DrawerAnimation extends Animation { |
| 22 Stream<double> get onPositionChanged => onValueChanged; | 22 Stream<double> get onPositionChanged => onValueChanged; |
| 23 | 23 |
| 24 bool get _isMostlyClosed => value <= -_kWidth / 2; | 24 bool get _isMostlyClosed => value <= -_kWidth / 2; |
| 25 | 25 |
| 26 DrawerAnimation() { | 26 DrawerAnimation() { |
| 27 value = -_kWidth; | 27 value = -_kWidth; |
| 28 } | 28 } |
| 29 | 29 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 level: level | 161 level: level |
| 162 ); | 162 ); |
| 163 | 163 |
| 164 return new Container( | 164 return new Container( |
| 165 style: _style, | 165 style: _style, |
| 166 inlineStyle: inlineStyle, | 166 inlineStyle: inlineStyle, |
| 167 children: [ mask, content ] | 167 children: [ mask, content ] |
| 168 ); | 168 ); |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |