addOutline method

Future<bool> addOutline({
  1. required String parentUuid,
  2. int insertIndex = -1,
  3. required String title,
  4. required int pageIndex,
})

Adds an outline to the current document. Parameters:

  • parentUuid The UUID of the parent outline under which the new outline will be added.
  • insertIndex The index at which to insert the new outline under the parent. Default is -1 (append to the end).
  • title The title of the new outline.
  • pageIndex The index of the page that the outline will point to. example:
bool result = await document.addOutline(
  parentUuid: parentOutline.uuid,
  insertIndex: 0,
  title: 'New Outline',
  pageIndex: 0
);

Implementation

Future<bool> addOutline(
    {required String parentUuid,
    int insertIndex = -1,
    required String title,
    required int pageIndex}) async {
  return await _channel.invokeMethod('add_outline', {
    'parent_uuid': parentUuid,
    'insert_index': insertIndex,
    'title': title,
    'page_index': pageIndex
  });
}