Showing
2 changed files
with
4 additions
and
0 deletions
@@ -254,11 +254,14 @@ class MultiPage extends Page { | @@ -254,11 +254,14 @@ class MultiPage extends Page { | ||
254 | while (_index < children.length) { | 254 | while (_index < children.length) { |
255 | final child = children[_index]; | 255 | final child = children[_index]; |
256 | 256 | ||
257 | + assert(() { | ||
257 | // Detect too big widgets | 258 | // Detect too big widgets |
258 | if (sameCount++ > maxPages) { | 259 | if (sameCount++ > maxPages) { |
259 | throw TooManyPagesException( | 260 | throw TooManyPagesException( |
260 | 'This widget created more than $maxPages pages. This may be an issue in the widget or the document. See https://pub.dev/documentation/pdf/latest/widgets/MultiPage-class.html'); | 261 | 'This widget created more than $maxPages pages. This may be an issue in the widget or the document. See https://pub.dev/documentation/pdf/latest/widgets/MultiPage-class.html'); |
261 | } | 262 | } |
263 | + return true; | ||
264 | + }()); | ||
262 | 265 | ||
263 | // Calculate available space of the current page | 266 | // Calculate available space of the current page |
264 | final freeSpace = (offsetStart == null) | 267 | final freeSpace = (offsetStart == null) |
-
Please register or login to post a comment