fluro_fork 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 87


The brightest, hippest, coolest router for Flutter.

Version Build Status Coverage

Version 1.6.0 (and higher) requires Flutter >= 1.12.0 and Dart >= 2.6.0. If you're running an older version of Flutter, use a version < 1.6.0.

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

Version compatability #

See CHANGELOG for all breaking (and non-breaking) changes.

Getting started #

You should ensure that you add the router as a dependency in your flutter project.

dependencies:
 fluro_fork: "^0.0.1"

You can also reference the git repo directly if you want:

dependencies:
 fluro_fork:
   git: git://github.com/brianschardt/fluro.git

You should then run flutter packages upgrade or update your packages in IntelliJ.

Example Project #

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

Setting up #

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

final router = Router();

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(Router 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.

You can use the Router with the MaterialApp.onGenerateRoute parameter via the Router.generator function. 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);

Fluro is a Yakka original.

0.0.1 #

  • Forked from fluro@1.6.3, and fixed issue for Flutter for web where buildContext is null. I.e. Error: 'dependOnInheritedWidgetOfExactType' was called on null is now fixed

example/lib/main.dart

/*
 * fluro
 * Created by Yakka
 * https://theyakka.com
 * 
 * Copyright (c) 2019 Yakka, LLC. All rights reserved.
 * See LICENSE for distribution and usage details.
 */
import 'components/app/app_component.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(AppComponent());
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fluro_fork: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fluro_fork/fluro_fork.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
78
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

We analyzed this package on Jul 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • fluro_fork that is a package requiring null.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test
test ^1.6.0