flight 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 47

Flight #

A modern, lightweight, extensible framework for creating rich RESTful APIs in Dart.

Please note:

Flight is not currently in a state where we would recommend use in a production environment. We do, however, encourage you to give it a try and see what you think; we'd love your feedback. As always, if you bump into any bugs or you would like to request a new feature, please create an issue and we will see to it as soon as possible.

0.0.4 #

  • Fixed onPreRoute / onPostRoute bug
  • Fixed missing braces in Response.dart

0.0.3 #

  • Added onPreRoute
  • Added onPostRoute

0.0.2 #

  • Moved project from @BradW to @HypertextPP
  • Added example
  • Formatted all files with dartfmt

0.0.1 #

  • Initial version


import 'package:flight/flight.dart';

void main() {
  Flight f = Flight(
    onBound: (port, addr) => print('Listening on ${addr}:${port}'),

  f(GET, '/test', (req, res) {

  f(POST, '/test', (req, res) {

  f(PUT, '/test', (req, res) {});

  f.group('/group', [
    f(GET, '/child-1', (req, res) {
      res.send('child 1');
    f(GET, '/child-2', (req, res) {
      res.send('child 2');

Use this package as a library

1. Depend on it

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

  flight: ^0.0.4

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:flight/flight.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 Mar 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

49 out of 49 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.

Fix lib/src/Flight.dart. (-1 points)

Analysis of lib/src/Flight.dart reported 2 hints:

line 49 col 32: This function has a return type of 'Future

line 62 col 19: Unnecessary new keyword.

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
body_parser ^1.1.1 1.1.1
http_parser ^3.1.3 3.1.4
Transitive dependencies
charcode 1.1.3
collection 1.14.12
dart2_constant 1.0.2+dart2
http_server 0.9.8+3
meta 1.1.8
mime 0.9.6+3
path 1.6.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6