retrolite 1.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 49

retrolite #

retrolite is a RESTful API client for Dart and Flutter, with a simple API syntax, without reflection.

This package uses the abstraction classes from flutuate_api, used to create RESTful api clients.

Configuration #

Add retrolite to pubspec.yaml under the dependencies field.

  retrolite: ^latest_version

Import #

Add the following import in your library :

import 'package:retrolite/retrolite.dart';

Example #

Below, a simple provider sample to REQ|RES API:

/// [REQ|RES]( API provider 
class ReqResApi extends IApi {
  /// Get the users list.
  Future<Response<ListUsers>> listUsers(int page) => 
      contentType: ContentType.json,
      deserializer: ListUsers.deserialize,

  /// Request the users list with delay.
  Future<Response<ListUsers>> listUsersWithDelay(int delay) => 
      queryParameters: {
        'delay': delay
      contentType: ContentType.json,
      deserializer: ListUsers.deserialize,

  /// Request the register service with success.
  Future<Response<RegisterResult>> register(RegisterContent content) =><RegisterResult>(
      deserializer: RegisterResult.deserialize,
      contentType: ContentType.json,
      body: content

Usage #

The sample project has more details about how to use the Retrolite package.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.1.0 #

  • Migrated package flutuate_api to here;
  • Implemented PUT, PATCH, HEAD, DELETE requests.

1.0.0 #

  • First release.

0.0.1 #

  • Initial version, created by Luciano Rodrigues


retrolite_example #

Demonstrates how to use the Retrolite package.

Getting Started #

This project is a starting point for a Dart/Flutter application that uses Retrolite. Please, see the sources codes.

Use this package as a library

1. Depend on it

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

  retrolite: ^1.1.0

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

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/Secrets.dart. (-1.49 points)

Analysis of lib/Secrets.dart reported 3 hints:

line 34 col 17: Unnecessary new keyword.

line 36 col 14: Unnecessary new keyword.

line 47 col 34: Unnecessary new keyword.

Fix lib/src/api/Headers.dart. (-1.49 points)

Analysis of lib/src/api/Headers.dart reported 3 hints:

line 10 col 12: Unnecessary new keyword.

line 15 col 12: Unnecessary new keyword.

line 71 col 12: Unnecessary new keyword.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
collection ^1.14.11 1.14.12
http ^0.12.0+2 0.12.0+4
Transitive dependencies
async 2.4.0
charcode 1.1.2
http_parser 3.1.3
meta 1.1.8
path 1.6.4
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.0.0 1.9.0
test ^1.0.0