mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
fix the hang when clicking the drawer in the stocks app
R=eseidel@chromium.org Review URL: https://codereview.chromium.org/980043005
This commit is contained in:
parent
3a73d55159
commit
37c27faae4
@ -73,9 +73,11 @@ class DrawerAnimation {
|
||||
|
||||
void _animateToPosition(double targetPosition) {
|
||||
double distance = (targetPosition - _position).abs();
|
||||
double targetDuration = distance / _kWidth * _kBaseSettleDurationMS;
|
||||
double duration = math.min(targetDuration, _kMaxSettleDurationMS);
|
||||
_animate(duration, _position, targetPosition, _kAnimationCurve);
|
||||
if (distance != 0) {
|
||||
double targetDuration = distance / _kWidth * _kBaseSettleDurationMS;
|
||||
double duration = math.min(targetDuration, _kMaxSettleDurationMS);
|
||||
_animate(duration, _position, targetPosition, _kAnimationCurve);
|
||||
}
|
||||
}
|
||||
|
||||
void handleFlingStart(event) {
|
||||
|
||||
@ -66,6 +66,7 @@ class AnimationGenerator extends FrameGenerator {
|
||||
this.curve: linear,
|
||||
Function onDone
|
||||
}):super(onDone: onDone) {
|
||||
assert(duration > 0);
|
||||
double startTime = 0.0;
|
||||
_stream = super.onTick.map((timeStamp) {
|
||||
if (startTime == 0.0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user