getOffset function Null safety

Offset getOffset(
  1. MultiTweenValues<AniProps> animation,
  2. SlideFrom? from
)

Implementation

Offset getOffset(MultiTweenValues<AniProps> animation, SlideFrom? from) {
  switch (from) {
    case SlideFrom.TOP:
      return Offset(0, -animation.get(AniProps.translateX));
    case SlideFrom.BOTTOM:
      return Offset(0, animation.get(AniProps.translateX));
    case SlideFrom.LEFT:
      return Offset(-animation.get(AniProps.translateX), 0);
    case SlideFrom.RIGHT:
      return Offset(animation.get(AniProps.translateX), 0);
    default:
      return Offset(0, 0);
  }
}