Show or Hide the UI in Our Flutter Viewer

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

Option
Description
automatic The toolbar and the user interface will show or hide when tapping on the page.
automaticBorderPages Like automatic, but the user interface will show on the first and last page of the document (only supported on Android).
alwaysVisible The user interface will always be visible.
alwaysHidden 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.
PdfConfiguration(
    userInterfaceViewMode: PspdfkitViewMode.automatic
);

Here’s how automatic works:

Android
iOS