BoltPDFViewer constructor

const BoltPDFViewer({
  1. Key? key,
  2. String? filePath,
  3. String? url,
  4. String? assetPath,
  5. PDFViewSource source = PDFViewSource.file,
  6. bool enableNavigation = true,
  7. bool showPageCounter = true,
  8. bool showToolbar = true,
  9. bool enableTextSelection = true,
  10. String? password,
  11. int defaultPage = 0,
  12. Color? loadingColor,
  13. String? title,
  14. List<Widget>? toolbarActions,
  15. Widget? loadingWidget,
  16. Widget? errorWidget,
  17. Color? backgroundColor,
  18. dynamic onViewCreated(
    1. PDFViewController
    )?,
  19. dynamic onPageChanged(
    1. int
    )?,
  20. dynamic onError(
    1. dynamic
    )?,
  21. bool isModal = false,
  22. IconData? fabIcon,
  23. VoidCallback? onFabPressed,
})

Implementation

const BoltPDFViewer({
  super.key,
  this.filePath,
  this.url,
  this.assetPath,
  this.source = PDFViewSource.file,
  this.enableNavigation = true,
  this.showPageCounter = true,
  this.showToolbar = true,
  this.enableTextSelection = true,
  this.password,
  this.defaultPage = 0,
  this.loadingColor,
  this.title,
  this.toolbarActions,
  this.loadingWidget,
  this.errorWidget,
  this.backgroundColor,
  this.onViewCreated,
  this.onPageChanged,
  this.onError,
  this.isModal = false,
  this.fabIcon,
  this.onFabPressed,
}) : assert(
        (source == PDFViewSource.file && filePath != null) ||
            (source == PDFViewSource.network && url != null) ||
            (source == PDFViewSource.asset && assetPath != null),
        'Must provide a filePath for file source, a url for network source, or an assetPath for asset source',
      );