pushAndRemoveUntil<T extends Object?> static method

Future pushAndRemoveUntil<T extends Object?>(
  1. Widget child, {
  2. NavigateAnimType animationType = NavigateAnimType.leftToRight,
})

we use this method to push and replace with current page.

Implementation

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