- Dart:Scalable Application Development
- Davy Mitchell Sergey Akopkokhyants Ivo Balbaert
- 152字
- 2021-07-09 18:56:20
Animating slides
The fullscreen display only has one slide at any time. A new slide will be initially placed on the top of the screen and will be gently lowered into view. The old slide will, from the presentation viewer's point of view, vanish instantly.

Using a timer
The periodic timer in Dart should be a familiar friend of yours by now. This is used to check whether the slide has reached the final position. If it is not there yet, then the position is updated:
new Timer.periodic(new Duration(milliseconds: 50), (timer) { if (isFullScreen && liveSlideY < 0) { liveSlide.style.top = liveSlideY.toString() + "px"; liveSlideY += 50; } });
You may be concerned that the Timer
object runs all the time, even when a presentation is not running fullscreen. In reality, they are very lightweight and the work that the animation performs is so minimal that it will have a negligible impact.
推薦閱讀
- Python編程自學手冊
- FFmpeg入門詳解:音視頻流媒體播放器原理及應用
- JavaScript+jQuery開發實戰
- Raspberry Pi for Secret Agents(Third Edition)
- SQL基礎教程(第2版)
- Extreme C
- 計算機應用基礎教程(Windows 7+Office 2010)
- Building Serverless Architectures
- QlikView Unlocked
- RESTful Web API Design with Node.js
- Java 9:Building Robust Modular Applications
- Learning iOS Penetration Testing
- Python機器學習
- OpenStack Sahara Essentials
- 面向對象程序設計教程(C#版)