Avatars
Avatars
MUIAvatars
A versatile avatar widget with support for images and fallback text.
Properties
imageUrl
: String - Image URL for the avatar. If the URL starts with 'http', it is treated as a network image; otherwise, it is treated as an asset image.size
: double - Size of the avatar, default:32
.fallbackText
: String - Fallback text for the avatar, limited to 2 characters.onTap
: VoidCallback - Callback function to be executed when the avatar is tapped.textColor
: Color - Text color for the fallback text.
Example Usage
Avatar with url and default size
Avatar without url with fallback text and default size
Avatar with user defined size
Avatar with user defined size and url
Notes
Provides a customizable avatar with support for images and fallback text.
Image URL can be either a network image or an asset image.
Fallback text is displayed if the image URL is empty or invalid.
Allows customization of size, fallback text, tap callback, and text color.
Fallback text is truncated to 2 characters.
Last updated