onShowFileChooser method

  1. @override
FutureOr<ShowFileChooserResponse?> onShowFileChooser(
  1. ShowFileChooserRequest request
)
inherited

Tell the client to show a file chooser. This is called to handle HTML forms with 'file' input type, in response to the user pressing the "Select File" button. To cancel the request, return a ShowFileChooserResponse with ShowFileChooserResponse.filePaths to null.

Note that the WebView does not enforce any restrictions on the chosen file(s). WebView can access all files that your app can access. In case the file(s) are chosen through an untrusted source such as a third-party app, it is your own app's responsibility to check what the returned Uris refer to.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • request: all platforms

Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.

Implementation

@override
FutureOr<ShowFileChooserResponse?> onShowFileChooser(
  ShowFileChooserRequest request,
) {
  return null;
}