PickFileAction class final
Opens the device's file chooser and gives the page what was picked,
uploading nothing. ${result} is the file's record, {"name", "size" (bytes), "type" (its MIME type, "" when unknown), "data"}: data is
the file as a data: URL, which an image shows as its url and a
cloudFiles action uploads as its source (the record itself is a
source too). With multiple ${result} is a list of records. With
content text the record has text (the file read as UTF-8) in
place of data; with none neither. When the person picks nothing the
chain stops there: the actions after it do not run. accept names the
kinds offered, as HTML's accept does: MIME types (image/*,
application/pdf) and extensions (.csv), separated by commas; a file
of another kind, or one over maxSizeMB, fails the action
(invalid-file-type, file-too-large). JSON: {"type": "pickFile", "accept": "image/*,.pdf"}; written pickFile accept="image/*,.pdf"; files=append(files, result).
- Inheritance
-
- Object
- ActionDef
- MediaAction
- PickFileAction
Constructors
- PickFileAction({String accept = '', bool multiple = false, PickedFileContent content = PickedFileContent.dataUrl, double maxSizeMB = 10, bool enabled = true, bool nonBlocking = false, Predicate? when})
-
const
Properties
- accept → String
-
The kinds of file offered (an expression): MIME types and extensions,
separated by commas. Empty: any file.
final
- content → PickedFileContent
-
final
- enabled → bool
-
False skips the action.
finalinherited
- fieldsJson → Json
-
Its own fields, as JSON (sparse): what toJson writes besides
typeand the common fields. An action class outside this library overrides this.no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- maxSizeMB → double
-
The largest file taken, in megabytes.
final
- multiple → bool
-
Whether several files can be picked:
${result}is then a list.final -
nested
→ List<
ActionDef> -
The actions it runs itself (branches, follow-ups), in order.
no setterinherited
- nonBlocking → bool
-
The chain doesn't wait for it, and its failure doesn't stop the chain.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selfAndNested
→ Iterable<
ActionDef> -
This action, then every action nested in it, depth first.
no setterinherited
- type → String
-
The JSON
type.no setteroverride - when → Predicate?
-
Runs only when it holds; null: always.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Json -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited