Skip to content

anilthummar/flutter_navigation_2.0

Repository files navigation

navigation_2o_web

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Differences Between Normal Navigation (Navigator 1.0) and Navigator 2.0

Navigator 1.0 (Imperative Navigation) Imperative Approach: You directly call methods like Navigator.push() and Navigator.pop() to manipulate the navigation stack. Simple API: Suitable for straightforward navigation use cases. Limited Control: Handling back button behavior, deep linking, and custom routing logic is more cumbersome. No Direct URL Handling: Not directly tied to the browser's URL bar in web applications, making deep linking and SEO more challenging.

Navigator 2.0 (Declarative Navigation) Declarative Approach: You define the navigation stack as a list of Page objects. The framework updates the UI based on the differences between the current and previous states. State Synchronization: The navigation stack is directly tied to the application state, enabling more complex and dynamic routing. Enhanced Control: Provides more control over back button handling, deep linking, and custom routing logic. URL Handling: Integrates well with web URL handling, making it easier to implement deep linking and respond to changes in the browser's URL bar.