SfPdfViewer.memory constructor Null safety

SfPdfViewer.memory(
  1. Uint8List bytes,
  2. {Key? key,
  3. bool canShowScrollHead = true,
  4. double pageSpacing = 4,
  5. PdfViewerController? controller,
  6. PdfZoomLevelChangedCallback? onZoomLevelChanged,
  7. bool canShowScrollStatus = true,
  8. PdfPageChangedCallback? onPageChanged,
  9. bool enableDoubleTapZooming = true,
  10. bool enableTextSelection = true,
  11. PdfTextSelectionChangedCallback? onTextSelectionChanged,
  12. PdfDocumentLoadedCallback? onDocumentLoaded,
  13. PdfDocumentLoadFailedCallback? onDocumentLoadFailed,
  14. bool enableDocumentLinkAnnotation = true,
  15. bool canShowPaginationDialog = true,
  16. Offset initialScrollOffset = Offset.zero,
  17. double initialZoomLevel = 1,
  18. PdfInteractionMode interactionMode = PdfInteractionMode.selection,
  19. PdfScrollDirection scrollDirection = PdfScrollDirection.vertical,
  20. PdfPageLayoutMode pageLayoutMode = PdfPageLayoutMode.continuous,
  21. Color searchTextHighlightColor = const Color(0xFFE56E00)}
)

Creates a widget that displays the PDF document obtained from Uint8List.

class MyAppState extends State{ @override void initState() { super.initState(); }

@override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: SfPdfViewer.memory( bytes, ), ), ); } }

Implementation

SfPdfViewer.memory(Uint8List bytes,
    {Key? key,
    this.canShowScrollHead = true,
    this.pageSpacing = 4,
    this.controller,
    this.onZoomLevelChanged,
    this.canShowScrollStatus = true,
    this.onPageChanged,
    this.enableDoubleTapZooming = true,
    this.enableTextSelection = true,
    this.onTextSelectionChanged,
    this.onDocumentLoaded,
    this.onDocumentLoadFailed,
    this.enableDocumentLinkAnnotation = true,
    this.canShowPaginationDialog = true,
    this.initialScrollOffset = Offset.zero,
    this.initialZoomLevel = 1,
    this.interactionMode = PdfInteractionMode.selection,
    this.scrollDirection = PdfScrollDirection.vertical,
    this.pageLayoutMode = PdfPageLayoutMode.continuous,
    this.searchTextHighlightColor = const Color(0xFFE56E00)})
    : _provider = MemoryPdf(bytes),
      assert(pageSpacing >= 0),
      super(key: key);