Acter Avatar

Acter Avatar is a package to generate different shapes of avatars by leveraging the combination of Multiavatar library and Colorize Text Avatar . The package is a derivative work from Acter a3 ongoing development.

CI Test Status

Build Status

Parameters of ActerAvatar:

Parameter Description Type
mode DisplayMode enum for rendering avatar shape (required). enum
size Size of Avatar (optional). double
badgeSize Size of Space Avatar parent badge (optional). double
tooltip ActerAvatar tooltip. TooltipStyle
secondaryToolTip Space Avatar OR Stack secondary avatar tooltip. TooltipStyle
avatarInfo Holds avatar data. See AvatarInfo below section. AvatarInfo
onAvatarTap Primary avatar interacton function (optional). Function()?
avatarsInfo for space and circular stack avatars.(optional) List
onParentBadgeTap Secondary avatar interaction function (optional). Function()?

AvatarInfo

AvatarInfo class allows you to store avatar related data. See API documentation for reference.

Usage of ActerAvatar 😎

ActerAvatar takes both mode and avatarInfo param to render avatar.

      ActerAvatar(
        mode: DisplayMode.DM,
        avatarInfo: AvatarInfo(
        uniqueId: '@aliKah:lorem.org', // required
        displayName: 'Ali Akalın',
        avatar: NetworkImage(*someImageLink*)),  // can be any image provider .i.e. AssetImage, MemoryImage and NetworkImage etc.
      ),

Alternatively you can also provide future avatar in AvatarInfo which will show fallback if data isn't readily available.

      ActerAvatar(
        mode: DisplayMode.DM,
        avatarInfo: AvatarInfo(
        uniqueId: '@aliKah:lorem.org',
        displayName: 'Ali Akalın',
        avatarFuture: someFuture),  // can be any image provider .i.e. AssetImage, MemoryImage and NetworkImage etc.
      ),

You can also provide list of AvatarInfo with avatarsInfo param for displaying parent badges and circular stacked avatars.

      ActerAvatar(
        mode: DisplayMode.Space,
        avatarInfo: AvatarInfo(
        uniqueId: '@aliKah:lorem.org',
        displayName: 'Ali Akalın',
        avatar: NetworkImage(*someImageLink*),
        avatarInfo: [
          // more `AvatarInfo` here.
        ]),
      ),

Credits & License

License

Fork of the great Colorize Text Avatar package by Deniz Çolak.

Any additional work: © 2023 Acter Association, Denmark

Libraries

acter_avatar