MultiPage class Null safety

Create a mult-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 insecable.

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, EdgeInsets? 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. [...]
read-only, inherited
A builder for the page header.
final
mainAxisAlignment MainAxisAlignment
How the children should be placed along the main axis.
final
margin EdgeInsets?
read-only, inherited
maxPages int
The maximum number of pages allowed before raising an error. This is not checked with a Release build.
final
mustRotate bool
read-only, inherited
orientation PageOrientation
read-only, inherited
pageFormat PdfPageFormat
read-only, inherited
pageTheme PageTheme
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
theme ThemeData?
read-only, inherited

Methods

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

Operators

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