to<T extends Object?> method

Future<T?> to<T extends Object?>(
  1. String routeName, {
  2. Object? arguments,
  3. Map<String, String>? queryParams,
  4. bool fullscreenDialog = false,
  5. bool maintainState = true,
  6. Widget builder(
    1. Widget route
    )?,
  7. Widget transitionsBuilder(
    1. BuildContext context,
    2. Animation<double> animation,
    3. Animation<double> secondAnimation,
    4. Widget child,
    )?,
})

Find the page with given routeName and add it to the route stack and trigger route transition.

If the page belongs to a sub route the page is added to it and only this particular sub route is triggered to animate transition.

It is similar to _navigate.toNamed method.

Implementation

Future<T?> to<T extends Object?>(
  String routeName, {
  Object? arguments,
  Map<String, String>? queryParams,
  bool fullscreenDialog = false,
  bool maintainState = true,
  Widget Function(Widget route)? builder,
  Widget Function(
    BuildContext context,
    Animation<double> animation,
    Animation<double> secondAnimation,
    Widget child,
  )? transitionsBuilder,
}) {
  return _navigationBuilder.to<T>(
    routeName,
    arguments: arguments,
    queryParams: queryParams,
    builder: builder,
    fullscreenDialog: fullscreenDialog,
    maintainState: maintainState,
    transitionsBuilder: transitionsBuilder,
  );
}