Acter Avatar is a package to generate avatar for the acter platform.
-
TextAvatars
based on text with custom color generator - [-] Generic
ActerAvatar
with:- automatic selection of shape & mode
- image loader
- optional border-support (with optional coloring support)
- multiavatar fallback support
- Generic
ActerAvatarPill
for inline displaying with:- internal
ActerAvatar
, click-action
- internal
TextAvatar can generate avatars based on any string. It generates the background and foreground color based on your input string and shows the avatar via the text initials. Enjoy it!
It is an easy and powerful package to generate text avatars for your users!
Let's see how to generate an avatar easily!
Here is the only mandatory parameter is text.
TextAvatar(
text: "Deniz Çolak",
)
Here is the predefined shapes: Rectangle, Circular or None, if shape is null or not defined the default value similar with Rectangle but not same.
Shape.Rectangle, Shape.Circular, Shape.None can be use.
TextAvatar(
shape: Shape.Circular,
text: "Deniz Çolak"
)
numberLetters parameter allows user to generate Avatar more specific number of character.
Developer can predefine
size
andnumberLetters
, ifnumberLetters
is null or not defined the default value is1
.
TextAvatar(
shape: Shape.Rectangle,
size: 35,
numberLetters: 2,
)
Other parameters can be change according to your specification.
Developers can extend the
TextAvatar
model according to their specification, currently below parameters are supported.
TextAvatar(
shape: Shape.Circular,
size: 35
fontSize: 14,
fontWeight: FontWeight.w600,
upperCase: true,
colorMaker: ColorMaker.bold(),
colorGenerator: // custom ColorGenerator-function. colorMaker takes precedence
numberLetters: 1,
text: this.widget.userdata.displayname,
sourceText: this.widget.userdata.username,
)
Fork of the great Colorize Text Avatar package by Deniz Çolak.
Any additional work: © 2023 Acter Association, Denmark