Skip to content

chyiiiiiiiiiiii/flutter_router_and_navigator_example

Repository files navigation

Flutter Router and Navigator Example

Chinese

This example is for Flutter book.

Description

This project is a comprehensive exploration of navigation techniques in Flutter applications. It demonstrates various navigation strategies, including custom navigation, named routes, and the use of the go_router package for more advanced routing scenarios. The project aims to provide developers with a robust understanding of how to manage navigation in Flutter apps effectively.

Table of Contents

Usage

The project is divided into different navigation strategies:

  1. Custom Navigator: Demonstrates a custom navigation setup using the Navigator widget.

    • Code Reference: lib/custom_navigator/main.dart
  2. Named Routes: Utilizes named routes for navigation, allowing for parameter passing and route management.

    • Code Reference: lib/navigator/main.dart
  3. Go Router: Implements the go_router package for declarative routing, including nested routes and redirection.

    • Code Reference: lib/go_router/main.dart
    • Code Reference: lib/go_router/app_router.dart
    • Code Reference: lib/go_router/router_refresh_stream.dart

Features

  • Custom Navigation: Learn how to implement custom navigation logic with animated transitions.
  • Named Routes: Understand how to use named routes for cleaner and more manageable navigation.
  • Go Router: Explore advanced routing capabilities with the go_router package, including route guards and state management.

Contributing

Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For questions or feedback, please reach out: