ZdsFilePicker class
Shows a component that can be used to select files and display their previews.
If showSelected is true, the attachments will be shown. There are two ways to display attachments, either vertically or horizontally
See also:
- ZdsFilePickerConfig, the configuration for this ZdsFilePicker.
FilePicker
, the interface this widget uses to select a file.ImagePicker
, a widget used to select a single image and show its preview.- ZdsFilePreview, which this component uses to show previews of the selected files.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ZdsFilePicker
- Available extensions
Constructors
-
ZdsFilePicker({required ZdsFilePickerController controller, Key? key, void onChange(List<
ZdsFileWrapper> items)?, void onPicked(List<ZdsFileWrapper> items)?, ZdsFilePickerConfig config = const ZdsFilePickerConfig(), ZdsFilePickerDisplayStyle? displayStyle = ZdsFilePickerDisplayStyle.vertical, ZdsFileValidator? validator = zdsValidator, void onError(BuildContext context, ZdsFilePickerConfig config, Exception exception)? = zdsFileError, List<ZdsFilePostProcessor> ? postProcessors = zdsDefaultPostProcessors, ZdsOptionDisplay optionDisplay = ZdsOptionDisplay.standard, bool showLinkName = true, bool showSelected = true, bool useCard = true, VisualDensity? visualDensity = VisualDensity.standard}) -
Creates a component that allows to select files and can display a preview of the selected files.
const
Properties
- config → ZdsFilePickerConfig
-
The configuration for this file picker.
final
- controller → ZdsFilePickerController
-
The controller attached to this file picker.
final
- displayStyle → ZdsFilePickerDisplayStyle?
-
Whether to show the attachments in a horizontal or vertical list.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onChange
→ void Function(List<
ZdsFileWrapper> items)? -
A function called whenever the selected items change, i.e. an item gets removed or added.
final
- onError → void Function(BuildContext context, ZdsFilePickerConfig config, Exception exception)?
-
A function called whenever any exception is thrown in selection process
final
-
onPicked
→ void Function(List<
ZdsFileWrapper> items)? -
A function called whenever one selection routine is done
final
- optionDisplay → ZdsOptionDisplay
-
Whether to show the picker option label.
final
-
postProcessors
→ List<
ZdsFilePostProcessor> ? -
List of processes a file should undergo post getting picked from file picker
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showLinkName → bool
-
Whether to allow the user to give a name to the links attached.
final
- showSelected → bool
-
Whether to show the selected files.
final
- useCard → bool
-
Whether to use a default card background. If false, uses a transparent background.
final
- validator → ZdsFileValidator?
-
Validations that are needed to be performed on a file
final
- visualDensity → VisualDensity?
-
The visual density of this card.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → ZdsFilePickerState -
Creates the mutable state for this widget at a given location in the tree.
override
-
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.
override
-
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