essential_rest is an API to consume REST web services, it does the JSON mapping for the Entity, besides allowing to keep the data in CACHE using Local Storage for fast loading and load reduction to the Server


A simple usage example:

import 'package:essential_rest/essential_rest.dart';
import 'package:essential_rest/src/response_list.dart';

//entity model definition
class ExampleModel {
  int id;
  int userId;
  String title;
  bool completed;

  ExampleModel({this.userId,, this.title, this.completed});

  ExampleModel.fromMap(Map<String, dynamic> json) {
    userId = json['userId'];
    id = json['id'];
    title = json['title'];
    completed = json['completed'];

  Map<String, dynamic> toMap() {
    final data = Map<String, dynamic>();
    data['userId'] = userId;
    data['id'] = id;
    data['title'] = title;
    data['completed'] = completed;
    return data;

void main() async {
  var rest = RestClientGeneric<ExampleModel>(factory: {ExampleModel: (x) => ExampleModel.fromMap(x)});
  rest.protocol = ProtocolType.https; = '';

  //get list of ExampleModel
  var resp = await rest.getAll('/todos');
  RList<ExampleModel> list = resp.resultListT;
  list.forEach((item) {
    print('list item: ${item.title}');

  //get single ExampleModel
  resp = await rest.get('/todos/1');
  var item = resp.resultT;
  print('single item: ${item.title}');

  //create new item
  resp = await'/todos', body: ExampleModel(title: 'test').toMap());
  print('create item: ${resp.status}');


A Dart library to facilitate service consumption and API Rest, without the need for automatic code generation or reflection