yeet 0.3.1+1 yeet: ^0.3.1+1 copied to clipboard
A dank and easy way to navigate using Router API of Navigator 2.0 - No boilerplate. No code generation. No classes. Just yeet!
yeet 👌 #
A dank way to navigate.
Still experimental!
How to yeet? #
- Install latest version of yeet:
dependencies:
flutter:
sdk: flutter
yeet: ^0.3.1
- 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!