PageTransition<T> constructor

PageTransition<T>({
  1. Key? key,
  2. required Widget child,
  3. required PageTransitionType type,
  4. Widget? childCurrent,
  5. BuildContext? ctx,
  6. bool inheritTheme = false,
  7. Curve curve = Curves.linear,
  8. Alignment? alignment,
  9. Duration duration = const Duration(milliseconds: 300),
  10. Duration reverseDuration = const Duration(milliseconds: 200),
  11. bool fullscreenDialog = false,
  12. bool opaque = false,
  13. bool? maintainStateData,
  14. RouteSettings? settings,
})

Page transition constructor. We can pass the next page as a child,

Implementation

PageTransition({
  Key? key,
  required this.child,
  required this.type,
  this.childCurrent,
  this.ctx,
  this.inheritTheme = false,
  this.curve = Curves.linear,
  this.alignment,
  this.duration = const Duration(milliseconds: 300),
  this.reverseDuration = const Duration(milliseconds: 200),
  this.fullscreenDialog = false,
  this.opaque = false,
  this.maintainStateData,
  super.settings,
})  : assert(inheritTheme ? ctx != null : true,
          "'ctx' cannot be null when 'inheritTheme' is true, set ctx: context"),
      super(
        pageBuilder: (BuildContext context, Animation<double> animation,
            Animation<double> secondaryAnimation) {
          return inheritTheme
              ? InheritedTheme.captureAll(ctx!, child)
              : child;
        },
        maintainState: maintainStateData ?? true,
        opaque: opaque,
        fullscreenDialog: fullscreenDialog,
      );