Avatars
The avatar components provide flexible ways to display user images, initials, or icons with various sizes, shapes, and status indicators.Basic Usage
ChromiaAvatar
A customizable avatar component for displaying user images, initials, or icons.Parameters
URL of the avatar image. If provided, displays the image from the network.
Custom image provider for the avatar. Allows using any Flutter image provider.
Custom child widget (overrides image). Use for displaying initials or icons.
Background color (visible when no image is displayed).
Foreground color (for text/icons in the avatar).
Size of the avatar. Options:
extraSmall (24px), small (32px), medium (40px), large (56px), extraLarge (72px).Shape of the avatar. Options:
circle, rounded, square.Border decoration for the avatar.
Callback when the avatar is tapped.
Factory Constructors
ChromiaAvatar.initials
Creates an avatar with initials.The initials to display (automatically converted to uppercase).
Background color of the avatar.
Color of the initials text.
ChromiaAvatar.icon
Creates an avatar with an icon.The icon to display.
Background color of the avatar.
Color of the icon.
Examples
Image Avatar
Initials Avatar
Icon Avatar
Rounded Square Avatar
Interactive Avatar
ChromiaAvatarWithStatus
An avatar with a status indicator for showing online/offline/busy states.Parameters
The avatar widget to display.
Status indicator. Options:
online (green), busy (red), away (yellow), offline (gray).Position of the status indicator. Options:
bottomRight, bottomLeft, topRight, topLeft.Examples
Online Status
Busy Status with Custom Position
ChromiaAvatarGroup
A group of overlapping avatars with a “+N” indicator for additional avatars.Parameters
List of avatars to display.
Maximum number of avatars to show before displaying the “+N” indicator.
Size of all avatars in the group.
Spacing between avatars (creates overlap effect).
Whether to show “+N” for additional avatars beyond the max.
Examples
Basic Avatar Group
Custom Spacing
Enums
ChromiaAvatarSize
extraSmall- 24px diametersmall- 32px diametermedium- 40px diameter (default)large- 56px diameterextraLarge- 72px diameter
ChromiaAvatarShape
circle- Circular avatarrounded- Rounded square avatarsquare- Square avatar with slight rounding
ChromiaAvatarStatus
online- User is online (green indicator)busy- User is busy (red indicator)away- User is away (yellow indicator)offline- User is offline (gray indicator)
ChromiaAvatarStatusPosition
bottomRight- Bottom right corner (default)bottomLeft- Bottom left cornertopRight- Top right cornertopLeft- Top left corner
