Beginner Flutter
Q19 / 100

How do you navigate to a new screen in Flutter using the imperative API?

Correct! Well done.

Incorrect.

The correct answer is B) Navigator.push(context, MaterialPageRoute(builder: (ctx) => NewScreen()))

B

Correct Answer

Navigator.push(context, MaterialPageRoute(builder: (ctx) => NewScreen()))

Explanation

To navigate to a new screen in Flutter, you use Navigator.push() with a MaterialPageRoute. The builder callback returns the widget to display on the new screen. Navigator.pop() takes you back.

Progress
19/100