ProfileAvatar class
A widget that displays a circle avatar with an image.
If image is not null, it will be used as the image.
If imageUrl is not null, it will be used as the image url, but if image is not null imageUrl will be ignored.
If allowEdit is true, the user will be able to change the image.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ProfileAvatar
Constructors
- ProfileAvatar({Key? key, XFile? image, String? imageUrl, bool allowEdit = false, OnImageChanged? onImageChanged, double radius = 20, void onImageRemoved()?, Color? backgroundColor, Widget addImageIcon = const Icon(Icons.add_a_photo_outlined), Alignment addImageIconAlignment = Alignment.bottomRight, Widget removeImageIcon = const Icon(Icons.close), Alignment removeImageIconAlignment = Alignment.topRight, OctoProgressIndicatorBuilder? loadingBuilder, GetImageSource? getImageSource, GetPreferredCameraDevice? getPreferredCameraDevice, ImageErrorWidgetBuilder? errorBuilder})
-
const
Properties
- addImageIcon → Widget
-
The icon to display when the user can add an image.
final
- addImageIconAlignment → Alignment
-
The alignment of the addImageIcon.
final
- allowEdit → bool
-
Whether the user can add or remove the image.
final
- backgroundColor → Color?
-
The background color of the circle avatar.
final
- errorBuilder → ImageErrorWidgetBuilder?
-
This widget will be displayed when the image fails to load.
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
- image → XFile?
-
The image to display.
final
- imageUrl → String?
-
The image url 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
- onImageChanged → OnImageChanged?
-
Called when the image selected by user.
final
- onImageRemoved → void Function()?
-
Called when the image is removed.
final
- radius → double
-
The radius of the circle.
final
- removeImageIcon → Widget
-
The icon to display when the user can remove the image.
final
- removeImageIconAlignment → Alignment
-
The alignment of the removeImageIcon.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ProfileAvatar> -
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}) → 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