File Picker

The File Picker action allows users to select one or more files from their device. This action supports filtering by file type, setting size limits, and optionally showing a toast or rebuilding the page after selection.

Use Cases

  • Uploading images, documents, or other files.

  • Allowing users to attach files to forms or messages.

  • Collecting documents for verification or storage.

Properties

Property
Description

fileType

A string representing the allowed file type(s) (e.g., "image", "pdf", "custom/*").

sizeLimit

Maximum file size allowed, in bytes.

showToast

Boolean indicating whether to show a success toast after file selection.

rebuildPage

Boolean to trigger a page rebuild after file selection. Useful for reflecting updated state.

isMultiSelected

Boolean that enables selection of multiple files at once. Default is false.

selectedPageState

An expression where the selected file(s) will be stored. Usually bound to a state variable.

Default Behavior

  • Opens the file picker on the user's device.

  • Stores the selected file(s) in the location specified by selectedPageState.

  • Optionally shows a toast and/or triggers a page rebuild based on configuration.

How to Use

  1. Attach the action to a widget event (e.g., button tap).

  2. Select File Picker from the action list.

  3. Specify file type, size limit, and any optional flags.

  4. Assign a selectedPageState variable where the file(s) will be stored.

Last updated