flutter_router 1.0.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

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 Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [flutter_router] that is in a package requiring null.

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.

Maintenance suggestions

Package is getting outdated. (-44.38 points)

The package was last published 75 weeks ago.


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.12 1.14.13
matcher 0.12.8
meta 1.1.8 1.2.1
path 1.7.0
quiver 2.1.3
sky_engine 0.0.99
stack_trace 1.9.5
typed_data 1.1.6 1.2.0
utf 0.9.0+5
vector_math 2.0.8
Dev dependencies