flouter 0.2.0 copy "flouter: ^0.2.0" to clipboard
flouter: ^0.2.0 copied to clipboard

A Flutter router that is based navigator 2.0 API and use Regexp to do path matching.

A Navigator 2.0 router for Flutter

Easy to use router library that do all the work for you !

Easy #

First create a MaterialApp.router :

return MaterialApp.router(
    title: 'Uri navigator App',
    routerDelegate: _routerDelegate,
    routeInformationParser: UriRouteInformationParser(),
);
copied to clipboard

Second initialize your _routerDelegate like this :

final _routerDelegate = UriRouterDelegate(
    pageNotFound: (routeInformation) => MaterialPage(
        key: ValueKey('not-found-page'),
        child: Scaffold(
        body: Center(
            child: Text('Page ${routeInformation.uri.path} not found'),
        ),
        ),
    ),
    initialUris: [
        Uri.parse('/'),
        Uri.parse('/test/titi/'),
    ],
    pages: {
        RegExp(r'^/$'): (_) => HomePage(),
        RegExp(r'^/test/([a-z]+)/$'): (routeInformation) => TestPage(routeInformation),
    },
);
copied to clipboard

That's all you have to do ;)

14
likes
130
points
49
downloads

Publisher

verified publisherkleak.dev

Weekly Downloads

2024.09.16 - 2025.03.31

A Flutter router that is based navigator 2.0 API and use Regexp to do path matching.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, meta, provider

More

Packages that depend on flouter