PageTransition<T> constructor

PageTransition<T>({
  1. Key? key,
  2. required Widget child,
  3. required PageTransitionType type,
  4. Widget? childCurrent = null,
  5. BuildContext? ctx,
  6. bool inheritTheme = false,
  7. Curve curve = Curves.linear,
  8. Alignment? alignment,
  9. Duration duration = const Duration(milliseconds: 200),
  10. Duration reverseDuration = const Duration(milliseconds: 200),
  11. bool fullscreenDialog = false,
  12. bool opaque = false,
  13. bool isIos = false,
  14. PageTransitionsBuilder matchingBuilder = const CupertinoPageTransitionsBuilder(),
  15. bool? maintainStateData,
  16. 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 = null,
  this.ctx,
  this.inheritTheme = false,
  this.curve = Curves.linear,
  this.alignment,
  this.duration = const Duration(milliseconds: 200),
  this.reverseDuration = const Duration(milliseconds: 200),
  this.fullscreenDialog = false,
  this.opaque = false,
  this.isIos = false,
  this.matchingBuilder = const CupertinoPageTransitionsBuilder(),
  this.maintainStateData,
  RouteSettings? 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;
        },
        settings: settings,
        maintainState: maintainStateData ?? true,
        opaque: opaque,
        fullscreenDialog: fullscreenDialog,
      );