import 'package:flutter/material.dart'; Function pageBuilder = (final Widget widget) => ( final BuildContext context, final Animation animation, final Animation secondaryAnimation, ) => widget; Function transitionsBuilder = ( final BuildContext context, final Animation animation, final Animation secondaryAnimation, final Widget child, ) => SlideTransition( position: Tween( begin: const Offset(0, 1), end: Offset.zero, ).animate(animation), child: Container( decoration: animation.isCompleted ? null : const BoxDecoration( border: Border( bottom: BorderSide( color: Colors.black, ), ), ), child: child, ), ); class SlideBottomRoute extends PageRouteBuilder { SlideBottomRoute(this.widget) : super( transitionDuration: const Duration(milliseconds: 150), pageBuilder: pageBuilder(widget), transitionsBuilder: transitionsBuilder as Widget Function( BuildContext, Animation, Animation, Widget, ), ); final Widget widget; }