Deepak
Committed by David PHAM-VAN

subject, body and emails parameter to pdf preview

@@ -36,6 +36,9 @@ class PdfPreview extends StatefulWidget { @@ -36,6 +36,9 @@ class PdfPreview extends StatefulWidget {
36 this.useActions = true, 36 this.useActions = true,
37 this.pages, 37 this.pages,
38 this.dynamicLayout = true, 38 this.dynamicLayout = true,
  39 + this.shareActionExtraBody,
  40 + this.shareActionExtraSubject,
  41 + this.shareActionExtraEmails,
39 }) : super(key: key); 42 }) : super(key: key);
40 43
41 /// Called when a pdf document is needed 44 /// Called when a pdf document is needed
@@ -97,6 +100,17 @@ class PdfPreview extends StatefulWidget { @@ -97,6 +100,17 @@ class PdfPreview extends StatefulWidget {
97 /// channel message while opened. 100 /// channel message while opened.
98 final bool dynamicLayout; 101 final bool dynamicLayout;
99 102
  103 + /// email subject when email application is selected from the share dialog
  104 + final String? shareActionExtraSubject;
  105 +
  106 + /// extra text to share with Pdf document
  107 + final String? shareActionExtraBody;
  108 +
  109 + /// list of email addresses which will be filled automatically if the email application
  110 + /// is selected from the share dialog.
  111 + /// This will work only for Android platform.
  112 + final List<String>? shareActionExtraEmails;
  113 +
100 @override 114 @override
101 _PdfPreviewState createState() => _PdfPreviewState(); 115 _PdfPreviewState createState() => _PdfPreviewState();
102 } 116 }
@@ -590,6 +604,9 @@ class _PdfPreviewState extends State<PdfPreview> { @@ -590,6 +604,9 @@ class _PdfPreviewState extends State<PdfPreview> {
590 bytes: bytes, 604 bytes: bytes,
591 bounds: bounds, 605 bounds: bounds,
592 filename: widget.pdfFileName ?? 'document.pdf', 606 filename: widget.pdfFileName ?? 'document.pdf',
  607 + body: widget.shareActionExtraBody,
  608 + subject: widget.shareActionExtraSubject,
  609 + emails: widget.shareActionExtraEmails,
593 ); 610 );
594 611
595 if (result && widget.onShared != null) { 612 if (result && widget.onShared != null) {