Damian Bast
Committed by David PHAM-VAN

Adds option to shrinkwrap preview and set scrollablePhysics to be able to disabl…

…e the scrollView inside another scrollable
@@ -41,6 +41,8 @@ class PdfPreviewCustom extends StatefulWidget { @@ -41,6 +41,8 @@ class PdfPreviewCustom extends StatefulWidget {
41 this.shouldRepaint = false, 41 this.shouldRepaint = false,
42 this.loadingWidget, 42 this.loadingWidget,
43 this.dpi, 43 this.dpi,
  44 + this.scrollPhysics,
  45 + this.shrinkWrap = false,
44 }) : super(key: key); 46 }) : super(key: key);
45 47
46 /// Pdf paper page format 48 /// Pdf paper page format
@@ -58,6 +60,12 @@ class PdfPreviewCustom extends StatefulWidget { @@ -58,6 +60,12 @@ class PdfPreviewCustom extends StatefulWidget {
58 /// Decoration of scrollView 60 /// Decoration of scrollView
59 final Decoration? scrollViewDecoration; 61 final Decoration? scrollViewDecoration;
60 62
  63 + /// Whether the scrollView should be shrinkwrapped
  64 + final bool shrinkWrap;
  65 +
  66 + /// The physics for the scrollView - e.g. use this to disable scrolling inside a scrollable
  67 + final ScrollPhysics? scrollPhysics;
  68 +
61 /// Decoration of PdfPreviewPage 69 /// Decoration of PdfPreviewPage
62 final Decoration? pdfPreviewPageDecoration; 70 final Decoration? pdfPreviewPageDecoration;
63 71
@@ -177,6 +185,8 @@ class PdfPreviewCustomState extends State<PdfPreviewCustom> @@ -177,6 +185,8 @@ class PdfPreviewCustomState extends State<PdfPreviewCustom>
177 185
178 return ListView.builder( 186 return ListView.builder(
179 controller: scrollController, 187 controller: scrollController,
  188 + shrinkWrap: widget.shrinkWrap,
  189 + physics: widget.scrollPhysics,
180 padding: widget.padding, 190 padding: widget.padding,
181 itemCount: pages.length, 191 itemCount: pages.length,
182 itemBuilder: (BuildContext context, int index) => GestureDetector( 192 itemBuilder: (BuildContext context, int index) => GestureDetector(