import 'package:flutter/material.dart';
import 'package:flyinsono/architecture/router/transition.dart';
import 'package:flyinsono/pages/auth/auth_board/state.dart';
import 'package:get/get.dart';
import 'package:get/get_navigation/src/routes/default_transitions.dart';

///授权页面过渡动效
class AuthBoardPageTransition extends CustomTransition {
  @override
  Widget buildTransition(
    BuildContext context,
    Curve? curve,
    Alignment? alignment,
    Animation<double> animation,
    Animation<double> secondaryAnimation,
    Widget transitionChild,
  ) {
    if (AuthBoardState.hasRoutePass) {
      return FTransitions.sharedAxisHorizontal.buildTransition(
        context,
        curve,
        alignment,
        animation,
        secondaryAnimation,
        transitionChild,
      );
    }
    return SlideRightTransition().buildTransitions(
      context,
      curve,
      alignment,
      animation,
      secondaryAnimation,
      transitionChild,
    );
  }
}
