CircularProfileAvatar class
CircularProfileAvatar allows developers to implement circular profile avatar with border, overlay, initialsText and many other features which simplifies developer's job. It is an alternative to Flutter's CircleAvatar Widget.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CircularProfileAvatar
Constructors
- CircularProfileAvatar(String imageUrl, {Text initialsText = const Text(''), bool cacheImage = true, double radius = 50.0, double borderWidth = 0.0, Color borderColor = Colors.white, Color backgroundColor = Colors.white, double elevation = 0.0, bool showInitialTextAbovePicture = false, GestureTapCallback? onTap, Color foregroundColor = Colors.transparent, PlaceholderWidgetBuilder? placeHolder, LoadingErrorWidgetBuilder? errorWidget, ImageWidgetBuilder? imageBuilder, bool? animateFromOldImageOnUrlChange, ProgressIndicatorBuilder? progressIndicatorBuilder, Widget? child, BoxFit imageFit = BoxFit.cover})
Properties
- animateFromOldImageOnUrlChange → bool?
-
When set to true it will animate from the old image to the new image
if the url changes.
final
- backgroundColor → Color
-
The color with which to fill the circle.
default value Colors.white
final
- borderColor → Color
-
The color with which to fill the border of the circle.
default value Colors.white
final
- borderWidth → double
-
sets the borderWidth of the circile,
default value is 0.0
final
- cacheImage → bool
-
Cache the image against imageUrl in app memory if set true. it is true by default.
final
- child → Widget?
-
Setting child will hide every other widget initialsText and profile picture against imageUrl.
Best use case is passing AssetImage as profile picture. You can pass imageUrl as empty string if you want to set child value.
final
- elevation → double
-
sets shadow of the circle,
default value is 0.0
final
- errorWidget → LoadingErrorWidgetBuilder?
-
Widget displayed while the target imageUrl failed loading, works only if cacheImage is true.
final
- foregroundColor → Color
-
sets the foregroundColor of the circle, It only works if showInitialTextAbovePicture is set to true.
foregroundColor doesn't include border of the circle.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageBuilder → ImageWidgetBuilder?
-
Optional builder to further customize the display of the image.
final
- imageFit → BoxFit
-
How to inscribe the image into the space allocated during layout.
Set the BoxFit value as you want.
final
- imageUrl → String
-
it takes a URL of the profile image.
final
- initialsText → Text
-
Sets the initials of user's name.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTap → GestureTapCallback?
-
sets onTap gesture.
final
- placeHolder → PlaceholderWidgetBuilder?
-
Widget displayed while the target imageUrl is loading, works only if cacheImage is true.
final
- progressIndicatorBuilder → ProgressIndicatorBuilder?
-
Widget displayed while the target imageUrl is loading, works only if cacheImage is true.
final
- radius → double
-
sets radius of the avatar circle, borderWidth is also included in this radius.
default value is 0.0
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showInitialTextAbovePicture → bool
-
Displays initials above profile picture if set to true, You can set foregroundColor value as well if showInitialTextAbovePicture
is set to true.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _CircularProfileAvatarState -
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