toRemove static method
Future
toRemove(
- Widget page, {
- NavType? 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: 300),
- bool fullscreenDialog = false,
- bool opaque = false,
Implementation
static Future toRemove(
Widget page, {
NavType? 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: 300),
bool fullscreenDialog = false,
bool opaque = false,
}) {
return navigationKey.currentState!.pushAndRemoveUntil(
type != null
? PageTransition(
type: _type(type),
child: page,
childCurrent: childCurrent,
ctx: ctx,
inheritTheme: inheritTheme,
curve: curve,
alignment: alignment,
duration: duration,
reverseDuration: reverseDuration,
fullscreenDialog: fullscreenDialog,
opaque: opaque,
)
: Platform.isIOS || Platform.isMacOS
? CupertinoPageRoute(builder: (context) => page)
: MaterialPageRoute(builder: (context) => page),
(route) => false);
}