ApiDocumentModel<T> constructor

ApiDocumentModel<T>(
  1. String endpoint,
  2. T initialValue, {
  3. Map<String, String> headers = const {},
})

Class that can retrieve data from the RestAPI and store it as a document.

Basically, you get a Map as a response of RestAPI and use it by converting it. The data is converted using fromResponse and toRequest.

Use get in the load() method and post in the save() method as HTTP methods.

Implementation

ApiDocumentModel(
  this.endpoint,
  T initialValue, {
  this.headers = const {},
}) : super(initialValue);