flutter_routing 0.1.1
flutter_routing: ^0.1.1 copied to clipboard

An object-oriented package allowing you to build up a navigation tree from well-defined classes.

Routing #

An object-oriented package allowing you to build up a navigation tree from well-defined classes.

You can also use it to have named routes with typed arguments.

Example #


final NorseRouter router = NorseRouter(
    children: [
      NorseViewPath(
          name: 'public',
          view: viewBuilder('public'),
          children: [
            NorseViewPath(
              name: 'login',
              view: viewBuilder('login'),
            ),
            NorseViewPath(
                name: 'register',
                view: viewBuilder('register'),
                children: [
                  NorsePath(
                      name: 'flow',
                      children: [
                        NorseViewPath(
                          name: 'godfather',
                          view: viewBuilder('godfather'),
                        ),
                        NorseViewPath(
                          name: 'username',
                          view: viewBuilder('username'),
                        ),
                      ]
                  )
                ]
            ),
            NorseViewPath(
                name: 'passwordForgotten',
                view: viewBuilder('passwordForgotten'),
                children: [
                  NorseViewPath(
                      name: 'codeValidation',
                      view: viewBuilder('codeValidation'),
                      children: [
                        NorseViewPath(
                          name: 'changePassword',
                          view: viewBuilder('changePassword'),
                        ),
                      ]
                  ),
                ]
            ),
          ]
      )
    ]
);

...
MaterialApp(
  onGenerateRoute: router.onGenerateRoute
)
...

Navigator.of(context).pushNamed('/public/login');


0
likes
100
pub points
39%
popularity

An object-oriented package allowing you to build up a navigation tree from well-defined classes.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

gaspard.mp.work@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_routing