ImageInput class

A widget that allows the user to select multiple images.

If images is not null, it will be used as the initial images.

If allowEdit is true, the user will be able to change the images.

Inheritance

Constructors

ImageInput.new({Key? key, int allowMaxImage = 1, OctoProgressIndicatorBuilder? loadingBuilder, Size imageSize = const Size(100, 100), double spacing = 10, double runSpacing = 10, BoxFit fit = BoxFit.cover, Widget addImageIcon = const Icon(Icons.camera_alt_outlined), BoxDecoration? addImageContainerDecoration, Widget removeImageIcon = const Icon(Icons.close), BoxDecoration? imageContainerDecoration, OnImageChanged? onImageSelected, void onImageRemoved(XFile image, int index)?, List<XFile>? images, bool allowEdit = true, GetImageSource? getImageSource, GetPreferredCameraDevice? getPreferredCameraDevice, ImageErrorWidgetBuilder? errorBuilder})
const

Properties

addImageContainerDecoration BoxDecoration?
The decoration of add image container.
final
addImageIcon Widget
The icon to display when the user can add an image.
final
allowEdit bool
Whether the user can add or remove the images.
final
allowMaxImage int
The images to display from network. The maximum number of images that can be selected.
final
errorBuilder ImageErrorWidgetBuilder?
Called when the image fails to load.
final
fit BoxFit
How to inscribe the image into the space allocated during layout.
final
getImageSource GetImageSource?
Called when the user clicks the addImageIcon.
final
getPreferredCameraDevice GetPreferredCameraDevice?
Called when the user clicks the addImageIcon and getImageSource is ImageSource.camera.
final
hashCode int
The hash code for this object.
no setterinherited
imageContainerDecoration BoxDecoration?
The decoration of image container.
final
images List<XFile>?
The images to display.
final
imageSize Size
The size of the image to display.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder → OctoProgressIndicatorBuilder?
This builder will be used to show a widget while the image is loading.
final
onImageRemoved → void Function(XFile image, int index)?
Called when the image is removed.
final
onImageSelected OnImageChanged?
Called when the image selected by user.
final
removeImageIcon Widget
The icon to display when the user can remove the image.
final
runSpacing double
How much space to place between the runs themselves in the cross axis.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spacing double
The spacing between the images.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ImageInput>
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