newScreen function

void newScreen(
  1. BuildContext context,
  2. dynamic screen()
)

Navigates to a new screen.

The NewScreen function navigates to a new screen specified by the provided Screen function.

  • context: The context of the current screen.
  • Screen: The function that returns the widget representing the new screen.

Implementation

void newScreen(BuildContext context, Function() screen) {
  Navigator.push(context, MaterialPageRoute(builder: (context) => screen()));
}