| Index: samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
|
| diff --git a/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart b/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
|
| index de8d13c579efed4a873f3123847c2dda8902e98f..ac6a8755ab9aa2a16a13ced0af005b502dff4c4e 100644
|
| --- a/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
|
| +++ b/samples/swarm/swarm_ui_lib/touch/Scrollbar.dart
|
| @@ -52,7 +52,7 @@ class Scrollbar implements ScrollListener {
|
| num _currentScrollStartOffset;
|
| bool _currentScrollVertical;
|
| num _currentScrollRatio;
|
| - num _timerId;
|
| + Timer _timer;
|
|
|
| bool _displayOnHover;
|
| bool _hovering = false;
|
| @@ -148,7 +148,7 @@ class Scrollbar implements ScrollListener {
|
| // Start hiding immediately if we aren't
|
| // scrolling or already in the process of
|
| // hidng the scrollbar
|
| - if (!_scrollInProgress && _timerId == null) {
|
| + if (!_scrollInProgress && _timer == null) {
|
| _boundHideFn();
|
| }
|
| });
|
| @@ -232,7 +232,8 @@ class Scrollbar implements ScrollListener {
|
| */
|
| void _onScrollerEnd(Event e) {
|
| _cancelTimeout();
|
| - _timerId = window.setTimeout(_boundHideFn, _DISPLAY_TIME);
|
| + _timer = new Timer(const Duration(milliseconds: _DISPLAY_TIME),
|
| + _boundHideFn);
|
| _scrollInProgress = false;
|
| }
|
| void onScrollerMoved(num scrollX, num scrollY, bool decelerating) {
|
| @@ -281,9 +282,9 @@ class Scrollbar implements ScrollListener {
|
| }
|
|
|
| void _cancelTimeout() {
|
| - if (_timerId != null) {
|
| - window.clearTimeout(_timerId);
|
| - _timerId = null;
|
| + if (_timer != null) {
|
| + _timer.cancel();
|
| + _timer = null;
|
| }
|
| }
|
|
|
|
|