goto static method

void goto(
  1. BuildContext context,
  2. Type? route, {
  3. Route transition(
    1. BuildContext,
    2. Widget
    )?,
  4. RouterParam? params,
})

The function to navigate to a specific route. You specify the route using a type NOT a string route name or a MaterialPageRoute.

Implementation

static void goto(
  BuildContext context,
  Type? route, {
  Route Function(BuildContext, Widget)? transition,
  RouterParam? params,
}) {
  var service = Momentum.service<MomentumRouter>(context);
  service._goto(
    context,
    route,
    transition: transition,
    params: params,
  );
}