append method

Future<NotionResponse> append({
  1. required String to,
  2. required Children children,
})

Append a block children to a specific block.

See more at https://developers.notion.com/reference/patch-block-children

Implementation

Future<NotionResponse> append({
  required String to,
  required Children children,
}) async {
  http.Response res = await http.patch(
      Uri.https(host, '/$v/$path/$to/children'),
      body: jsonEncode(children.toJson()),
      headers: {
        'Authorization': 'Bearer $token',
        'Content-Type': 'application/json; charset=UTF-8',
        'Notion-Version': dateVersion,
      });

  return NotionResponse.fromResponse(res);
}