yeet 0.2.0 yeet: ^0.2.0 copied to clipboard
a dank way to navigate. no boilerplate. no code generation. no classes. just yeet it.
yeet 👌 #
A dank way to navigate.
Still experimental!
How to yeet? #
- Install latest version of yeet:
dependencies:
flutter:
sdk: flutter
yeet: ^0.2.0
- Define your yeets:
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
and add the following arguments.
return MaterialApp.router(
routeInformationParser: YeetInformationParser(),
routerDelegate: YeeterDelegate(yeet: yeet),
);
- Set new paths.
context.yeet('/your/new/path');
context.yeet('can/be/relative');
- And pop.
context.yeet();
-
Enjoy!
-
Missing a feature? Have a suggestion? Found a bug? Open an issue. Thanks!