pushAndRemoveUntil static method

Future pushAndRemoveUntil(
  1. Widget child, {
  2. NavigateAnimType animationType = NavigateAnimType.leftToRight,
})

Pushes the route and removes all the previous routes.

Implementation

static Future<dynamic> pushAndRemoveUntil(Widget child, {NavigateAnimType animationType = NavigateAnimType.leftToRight}) {
  return navigatorKey.currentState!.pushAndRemoveUntil(_pageRouteBuilder(child, animationType: animationType), (_) => false);
}