flutter_router 1.0.4

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new73

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';
runApp(MaterialApp(
  onGenerateRoute: Router({
    '/accounts/{id}': (context, match) => Account(id: match.parameters['id'),
    '/': (context, match) => Index(),
  }).get,
));

[1.0.0] - 21.11.2018

  • First release

example/lib/main.dart

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(),
  }).get,
));

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

class Account extends StatelessWidget {
  final String id;

  Account(this.id);

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

class Index extends StatelessWidget {
  @override
  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:


dependencies:
  flutter_router: ^1.0.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
1.0.4 Nov 26, 2018 Go to the documentation of flutter_router 1.0.4 Download flutter_router 1.0.4 archive
1.0.3 Nov 25, 2018 Go to the documentation of flutter_router 1.0.3 Download flutter_router 1.0.3 archive
1.0.2 Nov 25, 2018 Go to the documentation of flutter_router 1.0.2 Download flutter_router 1.0.2 archive
1.0.1 Nov 25, 2018 Go to the documentation of flutter_router 1.0.1 Download flutter_router 1.0.1 archive
1.0.0 Nov 21, 2018 Go to the documentation of flutter_router 1.0.0 Download flutter_router 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs (-10 points)

10 out of 10 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Dependencies

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
matcher 0.12.4
meta 1.1.6
path 1.6.2
quiver 2.0.1
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
flutter_test