diff options
Diffstat (limited to 'lib/presentation/routes/widget')
-rw-r--r-- | lib/presentation/routes/widget/page_widget.dart | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/presentation/routes/widget/page_widget.dart b/lib/presentation/routes/widget/page_widget.dart new file mode 100644 index 0000000..8a08377 --- /dev/null +++ b/lib/presentation/routes/widget/page_widget.dart @@ -0,0 +1,21 @@ +import '../../../export.dart'; + +class MyPage<T> extends Page<T> { + const MyPage({required this.child, super.key}); + + final Widget child; + + @override + Route<T> createRoute(BuildContext context) { + return PageRouteBuilder( + settings: this, + pageBuilder: ( + BuildContext context, + Animation<double> animation, + Animation<double> secondaryAnimation, + ) { + return FadeTransition(opacity: animation, child: child); + }, + ); + } +} |