Skip to content
On this page

Avatar

A profile image with initials, icon, and name fallbacks.

Avatar in FluttyUIAvatar in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

Usage

const ui.Avatar(
  name: 'Alex Morgan',
  size: ui.ComponentSize.md,
)

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

Avatar

const Avatar({
  super.key,
  this.name,
  this.initials,
  this.imageUrl,
  this.assetPath,
  this.image,
  this.fallbackIcon,
  this.size,
  this.dimension,
  this.customSize,
  this.shape = AvatarShape.circle,
  this.backgroundColor,
  this.foregroundColor,
  this.borderRadius,
  this.fit = BoxFit.cover,
  this.showName = false,
  this.nameSpacing,
  this.placeholder,
});
ParameterTypeRequiredDefault
keyKey?Nonull
nameString?Nonull
initialsString?Nonull
imageUrlString?Nonull
assetPathString?Nonull
imageImageProvider<Object>?Nonull
fallbackIconWidget?Nonull
sizeAvatarSize?Nonull
dimensiondouble?Nonull
customSizedouble?Nonull
shapeAvatarShapeNoAvatarShape.circle
backgroundColorColor?Nonull
foregroundColorColor?Nonull
borderRadiusdouble?Nonull
fitBoxFitNoBoxFit.cover
showNameboolNofalse
nameSpacingdouble?Nonull
placeholderWidget?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/media/avatar/avatar.dart

This reference is generated from the Avatar declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI