FileFieldWidget class
file. Never directly typed into — state.value is always a stored
path (or, when FileComponent.multiple, a list of them), never free
text — so the display control is permanently read-only. The choose
control is separate: a choose/replace button (single) or an add button
beside the stored list (multiple), shown only when every one of these
holds, same "hard gate" rule the file atop this list documents for every
other field — state.enabled == false disables the real control, not
just its colours:
- the server left this field writable (
!component.readOnly); state.enabled— adisabled()closure or a disabled ancestor container is not a file-specific concern, but it gates this control the same as every other one;- the host supplied a picker (
state.filePicker).
A readOnly: true component shows FilamentStrings.fileFieldReadOnly
and stays inert even with a picker supplied — the server's word always
wins. Otherwise missing a picker shows FilamentStrings.filePickerUnavailable
instead — never a control that cannot work, the same principle
FilamentStrings.chartUnavailable follows for a missing chart renderer.
A merely-disabled-but-otherwise-workable field shows neither note, same
as every other disabled field type: it looks inert, it does not claim a
reason that isn't true.
The multiple variant renders one row per stored path (basename only) with
a per-item remove, and its add button stops being offered at
FileComponent.maxFiles — a hint, never a block: the server's write-time
array max is the rule. Each pick uploads through the unchanged
one-file-per-request endpoint, so a multiple field's list grows one
appended path per upload call.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FileFieldWidget
Constructors
- FileFieldWidget({required FileComponent component, required FieldState state, MediaSet? media, Key? key})
-
const
Properties
- component → FileComponent
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- media → MediaSet?
-
The record's resolved media for this field — null on create, and null
for a field the record carries no
'<name>.__media'sibling for. A stored value matching one of these items byuuiddisplays that item's name and thumbnail instead of the raw token; see_displayName.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → FieldState
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FileFieldWidget> -
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.
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, int wrapWidth = 65}) → 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