Skip to content

Sameer330/gorouter-flutter-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoRouter Tutorial

Flutter Web Project to learn GoRouter Package for Page Navigation in Web Application.

!! This repo is just for my reference. This application is just for understanding Page Navigation in Flutter Web.

Source: Flutter GoRouter

To Run this project

Run These Commands:

  • Clone Package git clone https://github.com/Sameer330/gorouter-flutter-tutorial.git

  • Shift to project directory cd gorouter_tutorial

  • Get All Packages flutter pub get

  • Run main.dart flutter run lib/main.dart

Packages Used (From pub)

  1. GoRouter - go_router

For Page Navigation with routes

  1. GetIt - get_it

For Creating Singleton Instances of GoRouter

Common Issue

  • GetIt package helps in creating singleton instances of a class object.
  • When testing the application on a browser, if get_it is not used, error is caused when hot reloaded multiple times.
  • Cause: Multiple instances of GoRouter are created with each hot reload.
  • Fix: Add GetIt package, create a singleton instance of GoRouter, Initialise in void main().

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published