| 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 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
| 6 | 6 |
| 7 import 'package:vector_math/vector_math.dart'; | 7 import 'package:vector_math/vector_math.dart'; |
| 8 import 'package:sky/animation/animation_performance.dart'; | 8 import 'package:sky/animation/animation_performance.dart'; |
| 9 import 'package:sky/widgets/animation_builder.dart'; | 9 import 'package:sky/widgets/animation_builder.dart'; |
| 10 import 'package:sky/widgets/animated_component.dart'; | 10 import 'package:sky/widgets/animated_component.dart'; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 void initState() { | 39 void initState() { |
| 40 _transform = new AnimationBuilder() | 40 _transform = new AnimationBuilder() |
| 41 ..position = new AnimatedType<Point>(Point.origin) | 41 ..position = new AnimatedType<Point>(Point.origin) |
| 42 ..opacity = new AnimatedType<double>(1.0, end: 0.0); | 42 ..opacity = new AnimatedType<double>(1.0, end: 0.0); |
| 43 | 43 |
| 44 _performance = _transform.createPerformance( | 44 _performance = _transform.createPerformance( |
| 45 [_transform.position, _transform.opacity], | 45 [_transform.position, _transform.opacity], |
| 46 duration: new Duration(milliseconds: _kCardDismissFadeoutMS)); | 46 duration: new Duration(milliseconds: _kCardDismissFadeoutMS)); |
| 47 _performance.addListener(_handleAnimationProgressChanged); | 47 _performance.addListener(_handleAnimationProgressChanged); |
| 48 watchPerformance(_performance); | 48 watch(_performance); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void syncFields(Dismissable source) { | 51 void syncFields(Dismissable source) { |
| 52 child = source.child; | 52 child = source.child; |
| 53 onDismissed = source.onDismissed; | 53 onDismissed = source.onDismissed; |
| 54 super.syncFields(source); | 54 super.syncFields(source); |
| 55 } | 55 } |
| 56 | 56 |
| 57 Point get _activeCardDragEndPoint { | 57 Point get _activeCardDragEndPoint { |
| 58 assert(_width != null); | 58 assert(_width != null); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 onPointerUp: _handlePointerUpOrCancel, | 156 onPointerUp: _handlePointerUpOrCancel, |
| 157 onPointerCancel: _handlePointerUpOrCancel, | 157 onPointerCancel: _handlePointerUpOrCancel, |
| 158 onGestureFlingStart: _handleFlingStart, | 158 onGestureFlingStart: _handleFlingStart, |
| 159 child: new SizeObserver( | 159 child: new SizeObserver( |
| 160 child: transformedChild, | 160 child: transformedChild, |
| 161 callback: _handleSizeChanged | 161 callback: _handleSizeChanged |
| 162 ) | 162 ) |
| 163 ); | 163 ); |
| 164 } | 164 } |
| 165 } | 165 } |
| OLD | NEW |