replace<T extends Object?> method
void
replace<T extends Object?>({
- required Widget old,
- required Widget to,
- QuickTransition? transitions,
A method that replaces the current route with a new one with the given child widget and transition type. It also preserves the type parameter of the current route.
Defines the available transition options for animations. Only one transition can be selected at a time.
Available transitions:
- QuickSlide: Quickly slides the content.
- QuickRotate: Rapidly rotates the content.
- QuickScale: Swiftly scales the content.
- QuickSize: Rapidly resizes the content.
- QuickFade: Swiftly fades the content.
The default transition is QuickFade.
Implementation
@optionalTypeArgs
void replace<T extends Object?>(
{required Widget old, required Widget to, QuickTransition? transitions}) {
return Navigator.of(this).replace<T>(
oldRoute: QuickRouter.builder(old, transitions),
newRoute: QuickRouter.builder(old, transitions));
}