PdfFlowView constructor

const PdfFlowView({
  1. Key? key,
  2. Uint8List? pdfData,
  3. String? pdfPath,
  4. double pageSpacing = 8,
  5. EdgeInsets padding = EdgeInsets.zero,
  6. Color? backgroundColor,
  7. void onPageTap(
    1. int page
    )?,
  8. Widget pagePlaceholderBuilder(
    1. BuildContext context,
    2. int page
    )?,
  9. double cacheExtent = 600,
  10. void onError(
    1. Object error
    )?,
  11. Widget errorBuilder(
    1. BuildContext context,
    2. Object error
    )?,
})

Creates a PdfFlowView.

Provide exactly one PDF source:

  • pdfData: the raw bytes of the PDF document.
  • pdfPath: a URL (starting with http:// or https://) or an asset path.

Implementation

const PdfFlowView({
  super.key,
  this.pdfData,
  this.pdfPath,
  this.pageSpacing = 8,
  this.padding = EdgeInsets.zero,
  this.backgroundColor,
  this.onPageTap,
  this.pagePlaceholderBuilder,
  this.cacheExtent = 600,
  this.onError,
  this.errorBuilder,
}) : assert(
       pdfPath != null || pdfData != null,
       'Either pdfPath or pdfData must be provided.',
     ),
     assert(
       pdfPath == null || pdfData == null,
       'Provide only one of pdfPath or pdfData, not both.',
     );