PageTransition<T> constructor
PageTransition<T> ({
- Key? key,
- required Widget child,
- required PageTransitionType type,
- Widget? childCurrent,
- BuildContext? ctx,
- bool inheritTheme = false,
- Curve curve = Curves.linear,
- Alignment? alignment,
- Duration duration = const Duration(milliseconds: 300),
- Duration reverseDuration = const Duration(milliseconds: 200),
- bool fullscreenDialog = false,
- bool opaque = false,
- bool? maintainStateData,
- 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,
);