Show or Hide the UI in Our Flutter Viewer

PSPDFKit for Flutter offers a few ways to show or hide the user interface. The table below outlines the supported options.

userInterfaceViewModeAutomatic The toolbar and the user interface will show or hide when tapping on the page
userInterfaceViewModeAutomaticBorderPages Like automatic, but the user interface will show on the first and last page of the document (only supported on Android)
userInterfaceViewModeAlwaysVisible The user interface will always be visible
userInterfaceViewModeAlwaysHidden The user interface will always be hidden

The user interface view mode can be changed using the userInterfaceViewMode configuration option. The following example shows how to use the automatic view mode:

// First copy the document from assets to the temporary directory.
await Pspdfkit.present(document.path, {
    userInterfaceViewMode: userInterfaceViewModeAutomatic

Here’s how userInterfaceViewModeAutomatic works: