2020-11-29 20:07:46 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
Function pageBuilder = (Widget widget) => (
|
|
|
|
BuildContext context,
|
|
|
|
Animation<double> animation,
|
|
|
|
Animation<double> secondaryAnimation,
|
|
|
|
) =>
|
|
|
|
widget;
|
|
|
|
|
|
|
|
Function transitionsBuilder = (
|
|
|
|
BuildContext context,
|
|
|
|
Animation<double> animation,
|
|
|
|
Animation<double> secondaryAnimation,
|
|
|
|
Widget child,
|
|
|
|
) {
|
|
|
|
return SlideTransition(
|
|
|
|
position: Tween<Offset>(
|
|
|
|
begin: const Offset(-1, 0),
|
|
|
|
end: Offset.zero,
|
|
|
|
).animate(animation),
|
|
|
|
child: Container(
|
|
|
|
decoration: animation.isCompleted
|
|
|
|
? null
|
|
|
|
: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
right: BorderSide(
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
class SlideRightRoute extends PageRouteBuilder {
|
|
|
|
SlideRightRoute(this.widget)
|
|
|
|
: super(
|
|
|
|
pageBuilder: pageBuilder(widget),
|
2021-03-15 15:39:44 +00:00
|
|
|
transitionsBuilder: transitionsBuilder as Widget Function(BuildContext, Animation<double>, Animation<double>, Widget),
|
2020-11-29 20:07:46 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
final Widget widget;
|
|
|
|
}
|