New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ListView.builder do not automaticly add pages when overflow #162
Comments
First, if you use MultiPage, the widget that can create new pages must be the top level. pdf.addPage(
MultiPage(
build: (Context context) => <Widget>[
Wrap(
children: List<Widget>.generate(issues.length, (int index) {
final issue = issues[index];
return Container(
child: Column(
children: <Widget>[
Header(
text: "Issue n°${issue.id}",
textStyle: TextStyle(fontSize: 20)),
Text("Description :",
textAlign: TextAlign.left,
style: TextStyle(fontSize: 15)),
],
),
);
}),
),
],
),
); |
Thank you ! |
@DavBfr Any updates ? |
Can it really fit? Try to enable the debug output, using the static variable: Document.debug = true; This will draw margins and widget limits like the flutter debug paint feature. |
No, it's a full child of wrapper that has to fit. If you want to split anywhere, remove the Container and Column and add the content directly as children of Wrap. The lib puts you in control to design beautiful pdf documents. |
yes, but if i have multiples elements to put inside my wrap how can i do without using a column ? |
final children = <Widget>[];
for (var item in items) {
children.add(Text('my title'));
children.add(Text('my content'));
children.add(Image(...));
}
pdf.addPage(
MultiPage(
build: (Context context) => <Widget>[
Wrap(children: children),
),
],
),
); |
@DavBfr The problem with your solution is that my items or no longer alligned in colllumn they are in row. How i can fix that ? |
you can force all widgets to occupy the full width, using a SizedBox for example: children.add(SizedBox(width:double.infinity, child:Text('my title'))); |
Thank you for your help ! |
Describe the bug
Hello,
When I use the widget ListView.builder and I have a problem. When the number of items in the list is greater than what the page can contain, the list is cut and the pdf ends. No new elements are automatically created to allow the remaining elements to be drawn.
To Reproduce
Code snippet to reproduce the behavior:
This is an example but any list wich has a number of elements superior of what the page could render will do the job.
Expected behavior
The list is going to be cut and no new page will be created for rendering the rest of it.
Screenshots
Flutter Doctor
Desktop (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: