tween method

GTween tween({
  1. required double duration,
  2. Object? blurX,
  3. Object? blurY,
  4. Object? angle,
  5. Object? distance,
  6. Color? color,
  7. EaseFunction? ease,
  8. double? delay,
  9. bool? useFrames,
  10. int overwrite = 1,
  11. VoidCallback? onStart,
  12. Object? onStartParams,
  13. VoidCallback? onComplete,
  14. Object? onCompleteParams,
  15. VoidCallback? onUpdate,
  16. Object? onUpdateParams,
  17. bool? runBackwards,
  18. bool? immediateRender,
  19. Map? startAt,
})

Creates a tween of the GDropShadowFilter properties.

duration is the duration of the tween.

blurX is the horizontal blur amount.

blurY is the vertical blur amount.

angle is the angle of the drop shadow.

distance is the distance of the drop shadow.

color is the color of the drop shadow.

ease is the easing function for the tween.

delay is the delay before starting the tween.

useFrames specifies whether to use frames for the tween.

overwrite specifies the behavior when overwriting an existing tween.

onStart is a callback function that is called when the tween starts.

onStartParams are the parameters for the onStart callback function.

onComplete is a callback function that is called when the tween completes.

onCompleteParams are the parameters for the onComplete callback function.

onUpdate is a callback function that is called when the tween updates.

onUpdateParams are the parameters for the onUpdate callback function.

runBackwards specifies whether to run the tween backwards.

immediateRender specifies whether to immediately render the tween.

startAt is a map of properties to set before starting the tween.

Implementation

GTween tween({
  required double duration,
  Object? blurX,
  Object? blurY,
  Object? angle,
  Object? distance,
  Color? color,
  EaseFunction? ease,
  double? delay,
  bool? useFrames,
  int overwrite = 1,
  VoidCallback? onStart,
  Object? onStartParams,
  VoidCallback? onComplete,
  Object? onCompleteParams,
  VoidCallback? onUpdate,
  Object? onUpdateParams,
  bool? runBackwards,
  bool? immediateRender,
  Map? startAt,
}) {
  final targetMap = {
    if (blurX != null) 'blurX': blurX,
    if (blurY != null) 'blurY': blurY,
    if (angle != null) 'angle': angle,
    if (distance != null) 'distance': distance,
    if (color != null) 'color': color,
  };
  return GTween.to(
      this,
      duration,
      targetMap,
      GVars(
        ease: ease,
        delay: delay,
        useFrames: useFrames,
        overwrite: overwrite,
        onStart: onStart,
        onStartParams: onStartParams,
        onComplete: onComplete,
        onCompleteParams: onCompleteParams,
        onUpdate: onUpdate,
        onUpdateParams: onUpdateParams,
        runBackwards: runBackwards,
        immediateRender: immediateRender,
        startAt: startAt,
      ));
}