navigateToView<T> method

Future<T?>? navigateToView<T>(
  1. Widget view, {
  2. dynamic arguments,
  3. int? id,
  4. bool? opaque,
  5. Curve? curve,
  6. Duration? duration,
  7. bool fullscreenDialog = false,
  8. bool? popGesture,
  9. bool preventDuplicates = true,
  10. @Deprecated('Prefer to use the transitionStyle instead of using this property. This will be removed in the next major version update for stacked.') Transition? transition,
  11. Transition? transitionStyle,
})

Pushes view onto the navigation stack

id is for when you are using nested navigation, as explained in documentation.

If you want the same behavior of ios that pops a route when the user drag, you can set popGesture to true.

preventDuplicates will prevent you from pushing a route that you already in, if you want to push anyway, set to false.

duration transition duration.

opaque Whether the route obscures previous routes when the transition is complete.

Implementation

Future<T?>? navigateToView<T>(
  Widget view, {
  dynamic arguments,
  int? id,
  bool? opaque,
  Curve? curve,
  Duration? duration,
  bool fullscreenDialog = false,
  bool? popGesture,
  bool preventDuplicates = true,
  @Deprecated('Prefer to use the transitionStyle instead of using this property. This will be removed in the next major version update for stacked.')
      Transition? transition,
  Transition? transitionStyle,
}) {
  return G.Get.to<T?>(
    () => view,
    arguments: arguments,
    id: id,
    opaque: opaque,
    preventDuplicates: preventDuplicates,
    curve: curve,
    duration: duration,
    fullscreenDialog: fullscreenDialog,
    popGesture: popGesture,
    transition: transitionStyle?.toGet ?? transition?.toGet,
  );
}