Overview
Hux UI provides avatar components for displaying user profile images:- HuxAvatar - Circular user images with initials fallback and built-in caching
- HuxAvatarGroup - Display multiple avatars with overlapping layouts
Features
- Built-in Image Caching - Network images use Flutter’s built-in caching for better performance
- Loading States - Smooth loading indicators while images load
- Error Handling - Graceful fallback to initials when images fail to load
- Offline Support - Cached images work offline
Component Variants
Basic Avatar
Simple avatar with name and initials:
Avatar with Network Image
Avatar with network profile image (automatically cached):- Automatic image caching for better performance
- Wireframe loading state while downloading
- Graceful fallback to initials if image fails to load
Avatar with Local Asset Image
Avatar with local asset image (instant loading):- Instant loading (no network required)
- Always available (bundled with app)
- Perfect for default avatars or placeholder images
Network vs Asset Images
| Feature | Network Image (imageUrl) | Asset Image (assetImage) |
|---|---|---|
| Loading | Shows wireframe placeholder | Instant |
| Availability | Requires internet | Always available |
| Updates | Can be updated remotely | Requires app update |
| App Size | No impact | Increases app size |
| Use Case | User profile photos | Default avatars, placeholders |
Gradient Avatar
Avatar with beautiful gradient background:
Small Avatar
Compact avatar for tight spaces:Large Avatar
Prominent avatar for important displays:Extra Large Avatar
Hero avatar for main displays:Avatar Group
Multiple avatars with overlapping layout:
Spaced Avatar Group
Multiple avatars with spacing between them:
HuxAvatar
With Gradient
Sizes
small- Compact avatarmedium- Standard avatar (default)large- Prominent avatarextraLarge- Hero avatar
Gradient Variants
bluePurple- Blue to purple gradientgreenBlue- Green to blue gradientorangeRed- Orange to red gradientpurplePink- Purple to pink gradienttealCyan- Teal to cyan gradient
HuxAvatarGroup
Display multiple avatars with overlapping or spaced layouts.Complete avatar documentation is coming soon. See the example app for more usage patterns.