Showing
2 changed files
with
9 additions
and
5 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 | - // Detect too big widgets | ||
258 | - if (sameCount++ > maxPages) { | ||
259 | - 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 | - } | 257 | + assert(() { |
258 | + // Detect too big widgets | ||
259 | + if (sameCount++ > maxPages) { | ||
260 | + throw TooManyPagesException( | ||
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'); | ||
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