navigateToPage method

Future<void> navigateToPage(
  1. BuildContext context,
  2. Widget page
)

Implementation

Future<void> navigateToPage(BuildContext context, Widget page) async {
  Navigator.of(context).push(
    MaterialPageRoute(builder: (context) => page),
  );
}