-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I press the shared button it calls onPrinted instead of onShared #1647
Comments
onShared: widget.onPrinted == null ? null : () => widget.onPrinted!(context), you pressed onShared but you called onPrinted, so it's normal. Sorry , i couldn't understand. Can you explain more ? |
I think this function should be called when I press the shared button. /// Called if the user shares the pdf document But in both cases, this other function is called when I print or share a PDF. These functions are found in the pdf_preview.dart file |
Lets look from another angle , what you want to do ? Like i dont want my client to share anything etc etc. |
Describe the bug
PdfPreview
if (widget.useActions && widget.allowSharing && info?.canShare == true) {
actions.add(PdfShareAction(
filename: widget.pdfFileName,
onShared:
widget.onPrinted == null ? null : () => widget.onPrinted!(context),
));
}
To Reproduce
return PdfPreview(
build: (format) => _buildPdfDocument(credential, image, format).save(),
allowSharing: true,
allowPrinting: true,
pageFormats: defaultPageFormats,
canChangeOrientation: false,
canDebug: false,
dpi: 72,
initialPageFormat: _getInitialPageFormat(credential),
pdfFileName: '${credential.fileName}.pdf',
onPrinted: (BuildContext context) async {
NavigatorService.pushReplacementNamed(HomeScreen.routeName);
},
onPrintError: (BuildContext context, dynamic error) async {
NavigatorService.pushReplacementNamed(HomeScreen.routeName);
});
}
When I press the shared button it calls onPrinted instead of onShared
Expected behavior
Custom onShared is never used, but must be called
The text was updated successfully, but these errors were encountered: