flight 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

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 #

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

0.0.1 #

  • Initial version

example/example.dart

import 'package:flight/flight.dart';

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

  f(GET, '/test', (req, res) {
    res.send('test');
  });

  f(POST, '/test', (req, res) {
    res.send(req.body);
  });

  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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
2
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:flight/flight.dart with components: io.

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. (-0.50 points)

Analysis of lib/src/Flight.dart reported 1 hint:

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

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.2.0 <3.0.0
body_parser ^1.1.1 1.1.1
http_parser ^3.1.3 3.1.3
Transitive dependencies
charcode 1.1.2
collection 1.14.12
dart2_constant 1.0.2+dart2
http_server 0.9.8+3
meta 1.1.7
mime 0.9.6+3
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6