FilePickerConfig class

The configuration used in a ZdsFilePicker.

maxPixelSize is used to set a maximum side dimension for an image. For example, if the maxPixelSize is 500, images can have a maximum resolution of 500x500. Any image above this resolution will be scaled down to this size.

See also:

Constructors

FilePickerConfig({int videoCompressionLevel = 3, int maxFilesAllowed = 0, int maxFileSize = 0, int maxPixelSize = 0, Set<String> allowedExtensions = const {}, bool useLiveMediaOnly = false, List<FilePickerOptions> options = const [FilePickerOptions.VIDEO, FilePickerOptions.FILE, FilePickerOptions.CAMERA, FilePickerOptions.GALLERY], String? giphyApiKey})
Creates the configuration to use in the ZdsFilePicker.
const

Properties

allowedExtensions Set<String>
The allowed file extensions.
final
giphyApiKey String?
API Key, required to use giphy service.
final
hashCode int
The hash code for this object.
no setterinherited
maxFilesAllowed int
Creates the configuration to use in the ZdsFilePicker. The maximum number of files allowed.
final
maxFileSize int
The maximum size of a file attachment in bytes.
final
maxPixelSize int
If the file picked is an image, its maximum side dimension once it's been selected.
final
options List<FilePickerOptions>
The options that will be shown in the file picker.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useLiveMediaOnly bool
The useLiveMediaOnly. flag use to disable photo library/gallery or file browser option. If true then we disable all photos & videos from file picker a the time of validation If false, all files are allowed. which are available in allowedExtensions. Defaults to false.
final
videoCompressionLevel int
Video compression quality
final

Methods

allowImages() bool
Returns true if any of the allowedExtensions is for the image
allowVideos() bool
Returns true if any of the allowedExtensions is for the video
copyWith({int? videoCompressionLevel, int? maxFilesAllowed, int? maxFileSize, int? maxPixelSize, Set<String>? allowedExtensions, bool? useLiveMediaOnly, List<FilePickerOptions>? options}) FilePickerConfig
Creates a copy of this FilePickerConfig, but with the given fields replaced wih the new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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