O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

Animating slides

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required