create method

Future<DocumentDto> create(
  1. String collection,
  2. Map<String, dynamic> data
)

Implementation

Future<DocumentDto> create(
  String collection,
  Map<String, dynamic> data,
) async {
  final json = asJsonObject(
    await http.post(documentUrl(collection), data),
    'A created document',
  );
  return DocumentDto.fromJson(json);
}