30 lines
855 B
Dart
30 lines
855 B
Dart
// page slide transition effect
|
|
import 'package:flutter/material.dart';
|
|
|
|
class SlideRightRoute extends PageRouteBuilder {
|
|
final Widget page;
|
|
SlideRightRoute({required this.page})
|
|
: super(
|
|
pageBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
) =>
|
|
page,
|
|
transitionsBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
Widget child,
|
|
) =>
|
|
SlideTransition(
|
|
textDirection: TextDirection.rtl,
|
|
position: Tween<Offset>(
|
|
begin: const Offset(-1, 0),
|
|
end: Offset.zero,
|
|
).animate(animation),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|