SlideTransitionX constructor

SlideTransitionX({
  1. Key? key,
  2. required Animation<double> position,
  3. bool transformHitTests = true,
  4. AxisDirection direction = AxisDirection.down,
  5. required Widget child,
})

Implementation

SlideTransitionX({
  Key? key,
  required Animation<double> position,
  this.transformHitTests = true,
  this.direction = AxisDirection.down,
  required this.child,
}) : super(key: key, listenable: position) {
  _tween = Tween(begin: const Offset(0, 1), end: Offset.zero);
  switch (direction) {
    case AxisDirection.up:
      _tween.begin = const Offset(0, 1);
      break;
    case AxisDirection.right:
      _tween.begin = const Offset(-1, 0);
      break;
    case AxisDirection.down:
      _tween.begin = const Offset(0, -1);
      break;
    case AxisDirection.left:
      _tween.begin = const Offset(1, 0);
      break;
  }
}