2 Best Flutter Route and Navigator Libraries

Google has introduced Navigator 2.0, the latest version of Flutter’s official router and navigation. Its API adds new classes to the framework in order to make the app’s screens a function of the app state and to provide the ability to parse routes from the underlying platform (like web URLs).

Navigator 2.0 is kind of complex. If you want to choose simpler routing libraries, here are they.

Table of Contents

fluro

Fluro is a beloved Flutter routing library. It adds flexible routing options like wildcards, named parameters and clear route definitions.

final router = FluroRouter();

//define routes with params
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, transitionType: TransitionType.inFromLeft);
}


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

sailor

sailor is another Flutter package for easy navigation management. It also supports parameters passing.

// Createa a route class
class Routes {
  static final sailor = Sailor();

  static void createRoutes() {
    sailor.addRoute(SailorRoute(
        name: "/color",
        builder: (context, args, params) {
          return ColorPage();
        },
      ));
  }
}
//navigate to defined route
Routes.sailor("/color");

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close