yeet 0.0.2 yeet: ^0.0.2 copied to clipboard
a dank way to navigate
yeet 👌 #
A dank way to navigate.
Still experimental!
How to yeet? #
- Define your yeet:
final yeet = Yeet(
children: [
Yeet(
path: '/',
builder: (_) => HomeView(),
),
Yeet(
path: r'/user/:id(\d+)',
builder: (params) => UserView(int.parse(params['id']!)),
children: [
Yeet(
path: 'posts',
builder: (params) => PostsView(int.parse(params['id']!)),
)
],
),
Yeet(
path: ':_(.*)',
builder: (_) => NotFoundView(),
),
],
);
- Turn your
MaterialApp
intoMaterialApp.router
.
return MaterialApp.router(
routeInformationParser: YeetInformationParser(),
routerDelegate: YeeterDelegate(yeet: yeet),
);
- Set new paths.
Router.of(context).routerDelegate.setNewRoutePath(
RouteInformation(location: '/your/new/path'));
- And yeet back.
Router.of(context).routerDelegate.popRoute();
- Enjoy!