onPrintRequest method

Future<bool?>? onPrintRequest(
  1. WebUri? url,
  2. PlatformPrintJobController? printJobController
)

Event fired when window.print() is called from JavaScript side. Return true if you want to handle the print job. Otherwise return false, so the PlatformPrintJobController will be handled and disposed automatically by the system.

url represents the url on which is called.

printJobController represents the controller of the print job created.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

Implementation

Future<bool?>? onPrintRequest(
    WebUri? url, PlatformPrintJobController? printJobController) {
  return null;
}