yeet 0.0.2 copy "yeet: ^0.0.2" to clipboard
yeet: ^0.0.2 copied to clipboard

discontinued
outdated

a dank way to navigate

yeet 👌 #

yeet


A dank way to navigate.


Still experimental!

How to yeet? #

  1. 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(),
    ),
  ],
);
  1. Turn your MaterialApp into MaterialApp.router.
return MaterialApp.router(
  routeInformationParser: YeetInformationParser(),
  routerDelegate: YeeterDelegate(yeet: yeet),
);
  1. Set new paths.
Router.of(context).routerDelegate.setNewRoutePath(
    RouteInformation(location: '/your/new/path'));
  1. And yeet back.
Router.of(context).routerDelegate.popRoute();
  1. Enjoy!