sh
Committed by David PHAM-VAN

Added a boolean toggle to show/hide debug switch

... ... @@ -5,6 +5,7 @@
- Fix raster crash on all OS.
- Improve PdfPreview widget
- Fix Linux build on Debian 9
- Added a boolean toggle to show/hide debug switch
## 5.2.1
... ...
... ... @@ -40,6 +40,7 @@ class PdfPreview extends StatefulWidget {
this.maxPageWidth,
this.canChangePageFormat = true,
this.canChangeOrientation = true,
this.canDebug = true,
this.actions,
this.pageFormats = _defaultPageFormats,
this.onError,
... ... @@ -89,6 +90,9 @@ class PdfPreview extends StatefulWidget {
/// Add a switch to change the page orientation
final bool canChangeOrientation;
/// Add a switch to show debug view
final bool canDebug;
/// Additionnal actions to add to the widget
final List<PdfPreviewAction>? actions;
... ... @@ -456,7 +460,7 @@ class _PdfPreviewState extends State<PdfPreview> with PdfPreviewRaster {
}
assert(() {
if (actions.isNotEmpty) {
if (actions.isNotEmpty && widget.canDebug) {
actions.add(
Switch(
activeColor: Colors.red,
... ...