route method

void route(
  1. BuildContext context,
  2. Widget page
)

Navigates to the specified page using the given context.

context is the BuildContext for navigation. page is the widget to navigate to.

Implementation

void route(BuildContext context, Widget page) {
  Navigator.push(
    context,
    MaterialPageRoute(
      builder: (context) => page,
    ),
  );
}