Committed by
David PHAM-VAN
Added a boolean toggle to show/hide debug switch
Showing
2 changed files
with
6 additions
and
1 deletions
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | - Fix raster crash on all OS. | 5 | - Fix raster crash on all OS. |
| 6 | - Improve PdfPreview widget | 6 | - Improve PdfPreview widget |
| 7 | - Fix Linux build on Debian 9 | 7 | - Fix Linux build on Debian 9 |
| 8 | +- Added a boolean toggle to show/hide debug switch | ||
| 8 | 9 | ||
| 9 | ## 5.2.1 | 10 | ## 5.2.1 |
| 10 | 11 |
| @@ -40,6 +40,7 @@ class PdfPreview extends StatefulWidget { | @@ -40,6 +40,7 @@ class PdfPreview extends StatefulWidget { | ||
| 40 | this.maxPageWidth, | 40 | this.maxPageWidth, |
| 41 | this.canChangePageFormat = true, | 41 | this.canChangePageFormat = true, |
| 42 | this.canChangeOrientation = true, | 42 | this.canChangeOrientation = true, |
| 43 | + this.canDebug = true, | ||
| 43 | this.actions, | 44 | this.actions, |
| 44 | this.pageFormats = _defaultPageFormats, | 45 | this.pageFormats = _defaultPageFormats, |
| 45 | this.onError, | 46 | this.onError, |
| @@ -89,6 +90,9 @@ class PdfPreview extends StatefulWidget { | @@ -89,6 +90,9 @@ class PdfPreview extends StatefulWidget { | ||
| 89 | /// Add a switch to change the page orientation | 90 | /// Add a switch to change the page orientation |
| 90 | final bool canChangeOrientation; | 91 | final bool canChangeOrientation; |
| 91 | 92 | ||
| 93 | + /// Add a switch to show debug view | ||
| 94 | + final bool canDebug; | ||
| 95 | + | ||
| 92 | /// Additionnal actions to add to the widget | 96 | /// Additionnal actions to add to the widget |
| 93 | final List<PdfPreviewAction>? actions; | 97 | final List<PdfPreviewAction>? actions; |
| 94 | 98 | ||
| @@ -456,7 +460,7 @@ class _PdfPreviewState extends State<PdfPreview> with PdfPreviewRaster { | @@ -456,7 +460,7 @@ class _PdfPreviewState extends State<PdfPreview> with PdfPreviewRaster { | ||
| 456 | } | 460 | } |
| 457 | 461 | ||
| 458 | assert(() { | 462 | assert(() { |
| 459 | - if (actions.isNotEmpty) { | 463 | + if (actions.isNotEmpty && widget.canDebug) { |
| 460 | actions.add( | 464 | actions.add( |
| 461 | Switch( | 465 | Switch( |
| 462 | activeColor: Colors.red, | 466 | activeColor: Colors.red, |
-
Please register or login to post a comment