FormBuilderFilePicker class

Field for image(s) from user device storage

Inheritance

Constructors

FormBuilderFilePicker({Key? key, required String name, FormFieldValidator<List<PlatformFile>>? validator, List<PlatformFile>? initialValue, InputDecoration decoration = const InputDecoration(), ValueChanged<List<PlatformFile>?>? onChanged, ValueTransformer<List<PlatformFile>?>? valueTransformer, bool enabled = true, FormFieldSetter<List<PlatformFile>>? onSaved, AutovalidateMode? autovalidateMode = AutovalidateMode.disabled, VoidCallback? onReset, FocusNode? focusNode, int? maxFiles, bool withData = kIsWeb, bool withReadStream = false, bool allowMultiple = false, bool previewImages = true, List<TypeSelector> typeSelectors = const [TypeSelector(type: FileType.any, selector: Icon(Icons.add_circle))], List<String>? allowedExtensions, void onFileLoading(FilePickerStatus)?, bool allowCompression = true, FileViewerBuilder? customFileViewerBuilder, Widget customTypeViewerBuilder(List<Widget> types)?})
Creates field for image(s) from user device storage

Properties

allowCompression bool
Whether to allow file compression
final
allowedExtensions List<String>?
Allowed file extensions for files to be selected
final
allowMultiple bool
Allows picking of multiple files
final
autovalidateMode AutovalidateMode
Used to enable/disable this form field auto validation and update its error text.
finalinherited
builder FormFieldBuilder<List<PlatformFile>>
Function that returns the widget representing this form field. It is passed the form field state as input, containing the current value and validation state of this field.
finalinherited
customFileViewerBuilder FileViewerBuilder?
If specified, the return value of this callback will be used to render the file viewer for the picked files. Specifying this callback can be useful to customize the look and feel of the file viewer, as well as to support user interactions with the picked files.
final
customTypeViewerBuilder → (Widget Function(List<Widget> types)?)
Allow to customise the view of the pickers.
final
decoration InputDecoration
finalinherited
enabled bool
Whether the form is able to receive user input.
finalinherited
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initialValue List<PlatformFile>?
An optional value to initialize the form field to, or null otherwise.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxFiles int?
Maximum number of files needed for this field
final
name String
Used to reference the field within the form, or to reference form data after the form is submitted.
finalinherited
onChanged ValueChanged<List<PlatformFile>?>?
Called when the field value is changed.
finalinherited
onFileLoading → (void Function(FilePickerStatus)?)
If you want to track picking status, for example, because some files may take some time to be cached (particularly those picked from cloud providers), you may want to set onFileLoading handler that will give you the current status of picking.
final
onReset VoidCallback?
Called when the field value is reset.
finalinherited
onSaved FormFieldSetter<List<PlatformFile>>?
An optional method to call with the final value when the form is saved via FormState.save.
finalinherited
previewImages bool
If set to true, a thumbnail of image files will be shown; else the default icon will be displayed depending on file type
final
restorationId String?
Restoration ID to save and restore the state of the form field.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeSelectors List<TypeSelector>
Create a list of type of document that you can pick
final
validator FormFieldValidator<List<PlatformFile>>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
finalinherited
valueTransformer → ValueTransformer<List<PlatformFile>?>?
Called just before field value is saved. Used to massage data just before committing the value.
finalinherited
withData bool
If withData is set, picked files will have its byte data immediately available on memory as Uint8List which can be useful if you are picking it for server upload or similar.
final
withReadStream bool
If withReadStream is set, picked files will have its byte data available as a Stream<List<int>> which can be useful for uploading and processing large files.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → FormBuilderFieldDecorationState<FormBuilderFilePicker, List<PlatformFile>>
Creates the mutable state for this widget at a given location in the tree.
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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