ApiDocumentModel<T> constructor
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);