MultiPage class

Create a multi-page section, with automatic overflow from one page to another

final pdf = Document();
pdf.addPage(MultiPage(build: (context) {
  return [
    Text('Hello'),
    Text('World'),
  ];
}));

An inner widget tree cannot be bigger than a page: A Widget cannot be drawn partially on one page and the remaining on another page: It's unbreakable.

A small set of Widget can automatically span over multiple pages, and can be used as a direct child of the build method: Flex, Partition, Table, Wrap, GridView, and Column.

final pdf = Document();
pdf.addPage(MultiPage(build: (context) {
  return [
    Text('Hello'),
    Wrap(
      children: [
        Text('One'),
        Text('Two'),
        Text('Three'),
      ]
    ),
  ];
}));

The Wrap Widget here is able to rearrange its children to span them across multiple pages. But a child of Wrap must fit in a page, or an error will raise.

Inheritance

Constructors

MultiPage({PageTheme? pageTheme, PdfPageFormat? pageFormat, required BuildListCallback build, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start, BuildCallback? header, BuildCallback? footer, ThemeData? theme, int maxPages = 20, PageOrientation? orientation, EdgeInsetsGeometry? margin, TextDirection? textDirection})

Properties

crossAxisAlignment CrossAxisAlignment
How the children should be placed along the cross axis.
final
A builder for the page footer.
final
hashCode int
The hash code for this object.
no setterinherited
A builder for the page header.
final
mainAxisAlignment MainAxisAlignment
How the children should be placed along the main axis.
final
margin EdgeInsetsGeometry?
no setterinherited
maxPages int
The maximum number of pages allowed before raising an error. This is not checked with a Release build.
final
mustRotate bool
no setterinherited
orientation PageOrientation
no setterinherited
pageFormat PdfPageFormat
no setterinherited
pageTheme PageTheme
finalinherited
resolvedMargin EdgeInsets?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme ThemeData?
no setterinherited

Methods

debugPaint(Context context) → void
inherited
generate(Document document, {bool insert = true, int? index}) → void
override
layout(Widget child, Context context, BoxConstraints constraints, {bool parentUsesSize = false}) PdfPoint
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Widget child, Context context) → void
inherited
postProcess(Document document) → void
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited