route method
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,
),
);
}