flutter_router 1.0.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

Flutter Router #

pub package

Flutter routing library that adds flexible routing options like parameters and clear route definitions.

Usage #

To use this plugin, add flutter_router as a dependency in your pubspec.yaml file.

Usage #

// Import package
import 'package:flutter_router/flutter_router.dart';
  onGenerateRoute: Router({
    '/accounts/{id}': (context, match) => Account(id: match.parameters['id'),
    '/': (context, match) => Index(),

[1.0.0] - 21.11.2018

  • First release


import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_router/flutter_router.dart';

void main() => runApp(MaterialApp(
  onGenerateRoute: Router({
    '/accounts/{id}': (context, match) => Account(match.parameters['id']),
    '/': (context, match) => Index(),

/*void main() => runApp(CupertinoApp(
  onGenerateRoute: CupertinoRouter({
    '/accounts/{id}': (context, match) => Account(match.parameters['id']),
    '/': (context, match) => Index(),

class Account extends StatelessWidget {
  final String id;


  Widget build(BuildContext context) {
    return Scaffold(body: Center(child: Text(this.id)));

class Index extends StatelessWidget {
  Widget build(BuildContext context) {
    return Scaffold(body: Center(child: Text('Index')));

Use this package as a library

1. Depend on it

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

  flutter_router: ^1.0.7

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:flutter_router/flutter_router.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

17 out of 17 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/flutter_router.dart.

Run flutter format to format lib/flutter_router.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
uri ^0.11.3+1 0.11.3+1
Transitive dependencies
collection 1.14.11 1.14.12
matcher 0.12.6
meta 1.1.7
path 1.6.4
quiver 2.0.5
sky_engine 0.0.99
stack_trace 1.9.3
typed_data 1.1.6
utf 0.9.0+5
vector_math 2.0.8
Dev dependencies