SfPdfViewer.memory constructor
SfPdfViewer.memory(
- Uint8List bytes, {
- Key? key,
- bool canShowScrollHead = true,
- double pageSpacing = 4,
- PdfViewerController? controller,
- PdfZoomLevelChangedCallback? onZoomLevelChanged,
- bool canShowPageLoadingIndicator = true,
- bool canShowScrollStatus = true,
- PdfPageChangedCallback? onPageChanged,
- bool enableDoubleTapZooming = true,
- bool enableTextSelection = true,
- PdfTextSelectionChangedCallback? onTextSelectionChanged,
- PdfHyperlinkClickedCallback? onHyperlinkClicked,
- PdfDocumentLoadedCallback? onDocumentLoaded,
- PdfDocumentLoadFailedCallback? onDocumentLoadFailed,
- PdfGestureTapCallback? onTap,
- PdfFormFieldValueChangedCallback? onFormFieldValueChanged,
- PdfFormFieldFocusChangeCallback? onFormFieldFocusChange,
- bool enableDocumentLinkAnnotation = true,
- bool canShowPaginationDialog = true,
- bool canShowSignaturePadDialog = true,
- Offset initialScrollOffset = Offset.zero,
- double initialZoomLevel = 1,
- double maxZoomLevel = 3,
- PdfInteractionMode interactionMode = PdfInteractionMode.selection,
- PdfScrollDirection scrollDirection = PdfScrollDirection.vertical,
- PdfPageLayoutMode pageLayoutMode = PdfPageLayoutMode.continuous,
- Color currentSearchTextHighlightColor = const Color.fromARGB(80, 249, 125, 0),
- Color otherSearchTextHighlightColor = const Color.fromARGB(50, 255, 255, 1),
- String? password,
- bool canShowPasswordDialog = true,
- bool canShowHyperlinkDialog = true,
Creates a widget that displays the PDF document obtained from Uint8List.
class MyAppState extends State
@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.canShowPageLoadingIndicator = true,
this.canShowScrollStatus = true,
this.onPageChanged,
this.enableDoubleTapZooming = true,
this.enableTextSelection = true,
this.onTextSelectionChanged,
this.onHyperlinkClicked,
this.onDocumentLoaded,
this.onDocumentLoadFailed,
this.onTap,
this.onFormFieldValueChanged,
this.onFormFieldFocusChange,
this.enableDocumentLinkAnnotation = true,
this.canShowPaginationDialog = true,
this.canShowSignaturePadDialog = true,
this.initialScrollOffset = Offset.zero,
this.initialZoomLevel = 1,
this.maxZoomLevel = 3,
this.interactionMode = PdfInteractionMode.selection,
this.scrollDirection = PdfScrollDirection.vertical,
this.pageLayoutMode = PdfPageLayoutMode.continuous,
this.currentSearchTextHighlightColor =
const Color.fromARGB(80, 249, 125, 0),
this.otherSearchTextHighlightColor = const Color.fromARGB(50, 255, 255, 1),
this.password,
this.canShowPasswordDialog = true,
this.canShowHyperlinkDialog = true,
this.enableHyperlinkNavigation = true,
}) : _provider = MemoryPdf(bytes),
assert(pageSpacing >= 0),
super(key: key);