insert method
Inserts item at the specified index.
//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new ordered list.
PdfOrderedList(
items: PdfListItemCollection()
..add(PdfListItem(text: 'PDF'))
//insert items to list item collection
..insert(0, PdfListItem(text: 'DocIO')),
font: PdfStandardFont(PdfFontFamily.helvetica, 16,
style: PdfFontStyle.italic))
..draw(
page: document.pages.add(), bounds: const Rect.fromLTWH(20, 20, 0, 0));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();
Implementation
void insert(int index, PdfListItem item, [double? itemIndent]) {
_helper.insert(index, item, itemIndent);
}