create static method

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

creates a new document in collection with id containing the provided data

Implementation

static Future<ParseDocument> create(
    String collection, Map<String, dynamic> data) async {
  print(jsonEncode(data));
  final response = await http.post('$_url/parse/classes/$collection',
      headers: _headers, body: jsonEncode(data));
  _errorHandler(response);
  return ParseDocument(
      response.body, response.statusCode == 201, data, collection);
}