All Projects → lukepighetti → Fluro

lukepighetti / Fluro

Licence: mit
Fluro is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions.

Programming Languages

dart
5743 projects
HTML
75241 projects

Projects that are alternatives of or similar to Fluro

Simple Php Router
Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.
Stars: ✭ 279 (-91.73%)
Mutual labels:  router, routing
CRRouter
A simple and powerful router
Stars: ✭ 54 (-98.4%)
Mutual labels:  router, routing
RouteNow
RouteNow is a small fast library ⚡ that will help you in developing a SinglePage Application without any dependencies like jQuery, AngularJs, vue.js or any of those bulky frameworks.
Stars: ✭ 17 (-99.5%)
Mutual labels:  router, routing
Ffrouter
Powerful and easy-to-use URL routing library in iOS that supports URL Rewrite(强大、易用、支持 URL Rewrite的 iOS 路由库)
Stars: ✭ 263 (-92.2%)
Mutual labels:  router, routing
react-mobx-router5
React components for routing solution using router5 and mobx
Stars: ✭ 58 (-98.28%)
Mutual labels:  router, routing
routex.js
🔼 Alternative library to manage dynamic routes in Next.js
Stars: ✭ 38 (-98.87%)
Mutual labels:  router, routing
router
Bidirectional Ring router. REST oriented. Rails inspired.
Stars: ✭ 78 (-97.69%)
Mutual labels:  router, routing
Swiftuirouter
Routing in SwiftUI
Stars: ✭ 242 (-92.82%)
Mutual labels:  router, routing
r5r
ipeagit.github.io/r5r/
Stars: ✭ 90 (-97.33%)
Mutual labels:  router, routing
go router
The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
Stars: ✭ 380 (-88.73%)
Mutual labels:  router, routing
journey
A conductor routing helper library
Stars: ✭ 35 (-98.96%)
Mutual labels:  router, routing
gatsby-plugin-dynamic-routes
Creating dynamic routes based on your environment and/or renaming existing routes
Stars: ✭ 14 (-99.58%)
Mutual labels:  router, routing
es6-router
🌐 Simple client side router built in ES6
Stars: ✭ 16 (-99.53%)
Mutual labels:  router, routing
neteng-roadmap
Network Engineering at Scale Roadmap/Landscape
Stars: ✭ 53 (-98.43%)
Mutual labels:  router, routing
Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (-92.7%)
Mutual labels:  router, routing
STCRouter
基于标准URL的iOS路由系统,可实现业务模块组件化,控制器之间零耦合,可实现黑白名单控制,可进行native降级到hybrid。
Stars: ✭ 19 (-99.44%)
Mutual labels:  router, routing
Klein.php
A fast & flexible router
Stars: ✭ 2,622 (-22.24%)
Mutual labels:  router, routing
Router
Router implementation for fasthttp
Stars: ✭ 234 (-93.06%)
Mutual labels:  router, routing
OpenBSDFirewall
Simple OpenBSD Home Firewall Config for ALIX Board
Stars: ✭ 41 (-98.78%)
Mutual labels:  router, routing
yew-router
Router extension to yew
Stars: ✭ 27 (-99.2%)
Mutual labels:  router, routing

English | Português



The brightest, hippest, coolest router for Flutter.

Version Build Status

Features

  • Simple route navigation
  • Function handlers (map to a function instead of a route)
  • Wildcard parameter matching
  • Querystring parameter parsing
  • Common transitions built-in
  • Simple custom transition creation
  • Follows stable Flutter channel
  • Null-safety

Example Project

There is a pretty sweet example project in the example folder. Check it out. Otherwise, keep reading to get up and running.

Getting started

First, you should define a new FluroRouter object by initializing it as such:

final router = FluroRouter();

It may be convenient for you to store the router globally/statically so that you can access the router in other areas in your application.

After instantiating the router, you will need to define your routes and your route handlers:

var usersHandler = Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
  return UsersScreen(params["id"][0]);
});

void defineRoutes(FluroRouter router) {
  router.define("/users/:id", handler: usersHandler);

  // it is also possible to define the route transition to use
  // router.define("users/:id", handler: usersHandler, transitionType: TransitionType.inFromLeft);
}

In the above example, the router will intercept a route such as /users/1234 and route the application to the UsersScreen passing the value 1234 as a parameter to that screen.

Navigating

You can use FluroRouter with the MaterialApp.onGenerateRoute parameter via FluroRouter.generator. To do so, pass the function reference to the onGenerate parameter like: onGenerateRoute: router.generator.

You can then use Navigator.push and the flutter routing mechanism will match the routes for you.

You can also manually push to a route yourself. To do so:

router.navigateTo(context, "/users/1234", transition: TransitionType.fadeIn);

Class arguments

Don't want to use strings for params? No worries.

After pushing a route with a custom RouteSettings you can use the BuildContext.settings extension to extract the settings. Typically this would be done in Handler.handlerFunc so you can pass RouteSettings.arguments to your screen widgets.

/// Push a route with custom RouteSettings if you don't want to use path params
FluroRouter.appRouter.navigateTo(
  context,
  'home',
  routeSettings: RouteSettings(
    arguments: MyArgumentsDataClass('foo!'),
  ),
);

/// Extract the arguments using [BuildContext.settings.arguments] or [BuildContext.arguments] for short
var homeHandler = Handler(
  handlerFunc: (context, params) {
    final args = context.settings.arguments as MyArgumentsDataClass;

    return HomeComponent(args);
  },
);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].