GemAnimation constructor

GemAnimation({
  1. AnimationType type = AnimationType.none,
  2. int duration = 0,
  3. void onCompleted()?,
})

Constructor for the animation class.

Parameters

  • IN type the animation type. By default it is AnimationType.none
  • IN duration the animation duration. The value 0 means a default duration set internally by the SDK
  • IN onCompleted the callback which is triggered when animation is completed

Implementation

GemAnimation({
  this.type = AnimationType.none,
  this.duration = 0,
  this.onCompleted,
}) {
  _progressListener = EventDrivenProgressListener();
  GemKitPlatform.instance.registerEventHandler(
    _progressListener.id,
    _progressListener,
  );

  _progressListener.registerOnCompleteWithDataCallback((_, __, ___) {
    if (onCompleted != null) {
      onCompleted!();
    }
  });
}