Sobes.tech
Junior — Middle

Can you explain what Navigator 1.0 is and how it is used?

sobes.tech AI

Answer from AI

Navigator 1.0 in Flutter is a class that manages the stack of routes (screens) of the application. It allows transitioning between screens, adding new ones, or going back.

Main methods:

  • push: add a new screen on top of the current one.
  • pop: close the current screen and return to the previous one.

Example usage:

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

// To go back:
Navigator.pop(context);

Navigator 1.0 is stack-based and easy to use, but for complex navigation with dynamic routes, Navigator 2.0 is often used.

Can you explain what Navigator 1.0 is and how it is… - sobes.tech