forward method

void forward()

Implementation

void forward() async {
  this._timer?.cancel();

  if (widget.controller != null &&
      widget.controller!.playbackNotifier.stream.value ==
          PlaybackState.pause) {
    return;
  }

  final nextFrame = await widget.imageLoader.frames!.getNextFrame();

  this.currentFrame = nextFrame.image;

  if (nextFrame.duration > Duration(milliseconds: 0)) {
    this._timer = Timer(nextFrame.duration, forward);
  }

  setState(() {});
}