pushReplacement<T extends Object?, T0 extends Object?> method

Future<PageRouteResult<T?>> pushReplacement<T extends Object?, T0 extends Object?>({
  1. required String name,
  2. dynamic arguments,
  3. TransitionAnimationConfig? config,
  4. T0? result,
})

替换当前界面 name 路由名 arguments 参数 config 转场动画配置 result 返回上一页的结果

Implementation

Future<PageRouteResult<T?>>
    pushReplacement<T extends Object?, T0 extends Object?>({
  required String name,
  dynamic arguments,
  TransitionAnimationConfig? config,
  T0? result,
}) {
  return _delegate.replace<T, T0>(
    name: name,
    arguments: arguments,
    result: result,
    transitionBuilder: config == null
        ? null
        : (RouteSettings settings, WidgetBuilder builder) =>
            AnimationTranslateTransition(
              builder: builder,
              config: config,
              settings: settings,
            ),
  );
}