This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +12
-22
lines changed
Expand file tree Collapse file tree 5 files changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ class Ticker {
5151
5252 _onTick (timeStamp);
5353
54- if (isTicking)
54+ // The onTick callback may have scheduled another tick already.
55+ if (isTicking && _animationId == null )
5556 _scheduleTick ();
5657 }
5758
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class TweenSimulation extends Simulation {
1414 final double end;
1515
1616 TweenSimulation (Duration duration, this .begin, this .end) :
17- _durationInSeconds = duration.inMilliseconds / 1000.0 {
17+ _durationInSeconds = duration.inMicroseconds / Duration . MICROSECONDS_PER_SECOND {
1818 assert (_durationInSeconds > 0.0 );
1919 assert (begin != null && begin >= 0.0 && begin <= 1.0 );
2020 assert (end != null && end >= 0.0 && end <= 1.0 );
Original file line number Diff line number Diff line change 22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5- import 'dart:async' ;
65import 'dart:sky' as sky;
76
87import 'package:sky/animation/animated_value.dart' ;
@@ -69,9 +68,7 @@ class Drawer extends StatefulComponent {
6968 _performance.attachedForce = kDefaultSpringForce;
7069
7170 if (navigator != null ) {
72- scheduleMicrotask (() {
73- navigator.pushState (this , (_) => _performance.reverse ());
74- });
71+ navigator.pushState (this , (_) => _performance.reverse ());
7572 }
7673 }
7774
@@ -120,14 +117,12 @@ class Drawer extends StatefulComponent {
120117 }
121118
122119 void _onDismissed () {
123- scheduleMicrotask (() {
124- if (navigator != null &&
125- navigator.currentRoute is RouteState &&
126- (navigator.currentRoute as RouteState ).owner == this ) // TODO(ianh): remove cast once analyzer is cleverer
127- navigator.pop ();
128- if (onDismissed != null )
129- onDismissed ();
130- });
120+ if (navigator != null &&
121+ navigator.currentRoute is RouteState &&
122+ (navigator.currentRoute as RouteState ).owner == this ) // TODO(ianh): remove cast once analyzer is cleverer
123+ navigator.pop ();
124+ if (onDismissed != null )
125+ onDismissed ();
131126 }
132127
133128 bool get _isMostlyClosed => _performance.progress < 0.5 ;
Original file line number Diff line number Diff line change 22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5- import 'dart:async' ;
65import 'dart:sky' as sky;
76
87import 'package:sky/animation/animated_value.dart' ;
@@ -72,11 +71,7 @@ class PopupMenu extends StatefulComponent {
7271 }
7372
7473 void _open () {
75- if (navigator != null ) {
76- scheduleMicrotask (() {
77- navigator.pushState (this , (_) => _close ());
78- });
79- }
74+ navigator.pushState (this , (_) => _close ());
8075 }
8176
8277 void _close () {
Original file line number Diff line number Diff line change 22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5- import 'dart:async' ;
65
76import 'package:sky/animation/animated_value.dart' ;
87import 'package:sky/animation/animation_performance.dart' ;
@@ -61,7 +60,7 @@ class SnackBar extends Component {
6160
6261 void _onDismissed () {
6362 if (onDismissed != null )
64- scheduleMicrotask (() { onDismissed (); } );
63+ onDismissed ();
6564 }
6665
6766 Widget build () {
You can’t perform that action at this time.
0 commit comments