KatMultiUploadFile<T extends KatMediaAsset> class

A bordered panel for picking files/photos/videos to upload, previewing what's already been picked, and removing any of them.

onPickFile is always shown; onPickImage and onPickVideo only when provided, so a host app can leave out camera-based actions it doesn't support. type also controls how medias is previewed below the actions: a photo grid for FileType.image, a plain file list otherwise.

T is whatever model the host app already uses for a picked/uploaded item - see KatMediaAsset for the properties this widget reads off it.

Inheritance

Constructors

KatMultiUploadFile({Key? key, required List<T> medias, required VoidCallback onPickFile, required ValueChanged<int> onRemoveFile, KatFileType type = KatFileType.any, VoidCallback? onPickImage, VoidCallback? onPickVideo})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
medias List<T>
Items already picked/uploaded, shown below the action row.
final
onPickFile VoidCallback
Opens the file/photo picker appropriate for type.
final
onPickImage VoidCallback?
Opens the camera to take a picture; the action is hidden when null.
final
onPickVideo VoidCallback?
Opens the camera to record a short video; the action is hidden when null.
final
onRemoveFile ValueChanged<int>
Called with the index into medias of the item the user removed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type KatFileType
Which kind of file onPickFile lets the user choose.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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