yeet 👌

yeet


A dank way to navigate.

Pub Version codecov


How to yeet?

  1. Install latest version of yeet:
dependencies:
  flutter:
    sdk: flutter
  yeet: ^0.3.2
  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(),
    ),
  ],
);
  1. Turn your MaterialApp into MaterialApp.router and add the following arguments.
return MaterialApp.router(
  routeInformationParser: YeetInformationParser(),
  routerDelegate: YeeterDelegate(yeet: yeet),
);
  1. Set new paths.
context.yeet('/your/new/path');
context.yeet('can/be/relative');
  1. And pop.
context.yeet();
  1. Enjoy!

  2. Missing a feature? Have a suggestion? Found a bug? Open an issue. Thanks!

Libraries

yeet