|
|
|
|
@ -2,14 +2,16 @@ import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/physics.dart';
|
|
|
|
|
|
|
|
|
|
/// Reusable spring route
|
|
|
|
|
class CustomPageRoute extends PageRouteBuilder {
|
|
|
|
|
class CustomPageRoute<T> extends PageRouteBuilder<T> {
|
|
|
|
|
final Widget page;
|
|
|
|
|
final AxisDirection direction;
|
|
|
|
|
final bool fullScreenDialog;
|
|
|
|
|
|
|
|
|
|
CustomPageRoute({required this.page, this.direction = AxisDirection.right})
|
|
|
|
|
CustomPageRoute({required this.page, this.direction = AxisDirection.right, this.fullScreenDialog = false})
|
|
|
|
|
: super(
|
|
|
|
|
transitionDuration: const Duration(milliseconds: 1500),
|
|
|
|
|
reverseTransitionDuration: const Duration(milliseconds: 500),
|
|
|
|
|
fullscreenDialog: fullScreenDialog,
|
|
|
|
|
pageBuilder: (_, __, ___) => page,
|
|
|
|
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
|
|
|
|
final spring = SpringDescription(mass: 1, stiffness: 100, damping: 15);
|
|
|
|
|
|