ui_router 1.2.4 copy "ui_router: ^1.2.4" to clipboard
ui_router: ^1.2.4 copied to clipboard

outdated

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
0
pub points
0%
popularity

Publisher

verified publisherflut.rbdog.biz

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on ui_router