SingleImagePicker class

SingleImagePicker widget can be used to upload a single image from the gallery. It can be used in three different styles:

  • default
  • compact
  • simple

The default style is the default style and it allows you to pass a custom child widget to the SingleImagePicker widget.

The compact style is a compact version of the SingleImagePicker widget. It is a small widget that can be used in a compact space.

The simple style is a simple version of the SingleImagePicker widget. It is a simple widget that can be used in a simple space.

The SingleImagePicker widget requires the uploadUrl parameter to be set. The uploadUrl parameter is the URL to which the image will be uploaded.

The setImageUrlFromResponse parameter is a function that can be used to set the image from the response. It is a function that takes the response as a parameter and returns the image.

Inheritance

Constructors

SingleImagePicker({Key? key, required Widget child(BuildContext context, Function upload)?, dynamic defaultImage, Function? onError, double height = 70, double width = 70, Widget? loading, ApiRequest? apiUploadImage, required dynamic setImageUrlFromResponse(dynamic response), int? imageQuality = 80, String imageSource = "gallery", String cameraDevice = "rear", bool canUpdate = true, BorderRadius? borderRadius, double? maxSize, List<String>? allowedMimeTypes})
SingleImagePicker.compact({Key? key, dynamic defaultImage, double height = 100, double width = 100, Function? onError, Widget? loading, ApiRequest? apiUploadImage, required dynamic setImageUrlFromResponse(dynamic response), int? imageQuality = 80, String imageSource = "gallery", String cameraDevice = "rear", bool canUpdate = true, BorderRadius? borderRadius, double? maxSize, List<String>? allowedMimeTypes})
Compact style The compact style is a compact version of the SingleImagePicker
SingleImagePicker.simple({Key? key, dynamic defaultImage, double height = 70, double width = 70, Function? onError, Widget? loading, ApiRequest? apiUploadImage, required dynamic setImageUrlFromResponse(dynamic response), int? imageQuality = 80, String imageSource = "gallery", String cameraDevice = "rear", bool canUpdate = true, BorderRadius? borderRadius, double? maxSize, List<String>? allowedMimeTypes})
Simple style The simple style is a simple version of the SingleImagePicker

Properties

allowedMimeTypes List<String>?
final
apiUploadImage ApiRequest?
final
borderRadius BorderRadius?
final
cameraDevice String
final
canUpdate bool
final
child Widget Function(BuildContext context, Function upload)?
final
defaultImage → dynamic
final
hashCode int
The hash code for this object.
no setterinherited
height double
final
imageQuality int?
final
imageSource String
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loading Widget?
final
maxSize double?
final
onError Function?
final
picker → ImagePicker
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setImageUrlFromResponse → dynamic Function(dynamic response)
final
style String?
final
width double
final

Methods

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