MediaPicker class

A class for handling media selection and capture.

Constructors

MediaPicker({required BuildContext context, int maxLimit = 1, String cancelText = "Cancel", String doneText = "Done", String moreText = "Select more", String openSettingText = "open settings", String emptyText = "No file found.This may be because storage is empty or the app doesn’t have permission to access them.", MediaType mediaType = MediaType.image})
Creates a MediaPicker instance.

Properties

cancelText String
The text shown on the cancel button in the picker UI.
final
context BuildContext
The build context where the media picker is used.
final
doneText String
The text shown on the done/confirm button in the picker UI.
final
emptyText String
The text shown when no file founded.
final
hashCode int
The hash code for this object.
no setterinherited
maxLimit int
The maximum number of media items that can be selected.
final
mediaType MediaType
The type of media that can be picked (image, video, or document).
final
moreText String
The text shown on the selected permission state for select other medias.
final
openSettingText String
The text shown to open the app settings.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

capturedFile({bool? allowRecord}) Future<File?>
Opens the camera screen and returns the captured file path.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
picFile() Future<File?>
Opens the system file picker to select a document.
showPicker() Future<List<String>>
Opens the media picker and returns a list of selected media files.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited