RestToOfflineFirstConverter constructor

RestToOfflineFirstConverter({
  1. required String endpoint,
  2. Map<String, String>? headers,
  3. String? topLevelKey,
})

Convert a JSON API payload into an OfflineFirstModel, output via generate or saveToFile.

This will not map associations or non-primitive types.

Implementation

RestToOfflineFirstConverter({
  required this.endpoint,
  this.headers,
  this.topLevelKey,
}) {
  _client = Client();
  headers?.addAll({'Content-Type': 'application/json'});
}