David PHAM-VAN

Fix MultiPage max height

@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 * Fix dart lint warnings 2 * Fix dart lint warnings
3 * Improve font bounds calculation 3 * Improve font bounds calculation
4 * Add RichText Widget 4 * Add RichText Widget
  5 +* Fix MultiPage max height
5 6
6 # 1.3.2 7 # 1.3.2
7 * Update Readme 8 * Update Readme
@@ -226,13 +226,16 @@ class MultiPage extends Page { @@ -226,13 +226,16 @@ class MultiPage extends Page {
226 child.layout(context, childConstraints, parentUsesSize: false); 226 child.layout(context, childConstraints, parentUsesSize: false);
227 227
228 if (offsetStart - child.box.height < offsetEnd) { 228 if (offsetStart - child.box.height < offsetEnd) {
229 - if (child.box.height < pageFormat.height - margin.vertical) { 229 + if (child.box.height <= pageFormat.height - margin.vertical) {
230 context = null; 230 context = null;
231 continue; 231 continue;
232 } 232 }
233 233
234 if (!(child is SpanningWidget)) { 234 if (!(child is SpanningWidget)) {
235 - throw Exception("Widget won't fit into the page"); 235 + throw Exception(
  236 + 'Widget won\'t fit into the page as its height (${child.box.height}) '
  237 + 'exceed a page height (${pageFormat.height - margin.vertical}). '
  238 + 'You probably need a SpanningWidget or use a single page layout');
236 } 239 }
237 240
238 final SpanningWidget span = child; 241 final SpanningWidget span = child;