ui_router 1.2.0 icon indicating copy to clipboard operation
ui_router: ^1.2.0 copied to clipboard

Super Simple, Minimal, Lightweight Router. Easy to use and organize the pages on your application.

Header

Simple UI Router #

https://pub.dev/packages/ui_router

router #

final router = UiRouter(
  pages: [
    UiPage(
      id: 'A',
      build: (params) => PageA(),
    ),
    UiPage(
      id: 'B',
      build: (params) => PageB(params['message']),
    ),
    // ...this is all pages in my app
  ],
);

use as a widget (start with page A) #

router.widget()

push (go to page B) #

router.push('B');

push with params #

router.push('B', params: {'message': 'HELLO😁'});

pop (back one page) #

router.pop();

pop until the specified page #

router.popTo('O');

do something before every push #

router.willPush((left, right) {
  // always allow push
  return true;
});

do something before every pop #

router.willPop((left, right) {
  // always allow pop
  return true;
});

see the page IDs stack #

print(router.stack());

show loading with a task #

router.loading(
  label: 'Now Loading...',
  task: () async {
    await Future.delayed(Duration(seconds: 5));
  },
);

πŸ˜„ Using Navigator 2.0
πŸŽ‰ Contributions are welcomed!

0
likes
130
pub points
33%
popularity

Publisher

verified publisher iconcasinoplus.rbdog.biz

Super Simple, Minimal, Lightweight Router. Easy to use and organize the pages on your application.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on ui_router