import 'package:flutter/material.dart';

class CustomNavigatorPop extends PageRouteBuilder {
  CustomNavigatorPop({required this.child})
      : super(
          transitionDuration: Duration(milliseconds: 100),
          pageBuilder: (context, animation, secondaryAnimation) => child,
        );

  final Widget child;

  @override
  Widget buildTransitions(BuildContext context, Animation<double> animation,
          Animation<double> secondaryAnimation, Widget child) =>
      SlideTransition(
        position: Tween<Offset>(
          begin: Offset(-1, 0),
          end: Offset.zero,
        ).animate(animation),
        child: child,
      );
}
