avataaar_image 1.0.4+1 copy "avataaar_image: ^1.0.4+1" to clipboard
avataaar_image: ^1.0.4+1 copied to clipboard

discontinued
outdated

Flutter wrapper widget for Avataaars API allowing to generate and display avatar images.

avataaar_image #

pub package

Flutter wrapper widget for Avataaars API - a free online avatar generator for anyone to make their beautiful personal avatar easily.

AvataaarImage example

Avataaars #

Credits to Pablo Stanley and Fang-Pen Lin for creating and making Avataaars available to use. 👏

Getting Started #

  1. Create Avataaar object:
// Create avatar with default constructor
Avataaar(
  skin: Skin.pale,
  style: Style.circle,
  top: Top.longHairCurly(
    accessoriesType: AccessoriesType.Round,
    facialHair: FacialHair.beardMagestic(
      facialHairColor: FacialHairColor.BlondeGolden,
    ),
  ),
);

// Randomize all properties
Avataaar.random();

// Or mix both
Avataaar.random(
  skin: Skin.pale,
  style: Style.circle,
  top: Top.longHairCurly(
    accessoriesType: AccessoriesType.Round,
    facialHair: FacialHair.random,
  ),
);
  1. Create AvataaarImage widget and pass it the avatar:
AvataaarImage(
  avatar: avatar,
  errorImage: Icon(Icons.error),
  placeholder: CircularProgressIndicator(),
  width: 128.0,
);

// By default package will use CachedNetworkImage to render the image. If it doesn't fit your 
// needs it's possible to use [builder] constructor and create widget for given image url:
AvataaarImage.builder(
  avatar: avatar,
  builder: (context, url) {
    // ...
  },
)

Persisting avatars #

Use Avataaar.toJson() and Avataaar.fromJson(String) methods to serialize/deserialize avatars.

14
likes
0
pub points
39%
popularity

Publisher

unverified uploader

Flutter wrapper widget for Avataaars API allowing to generate and display avatar images.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

cached_network_image, flutter

More

Packages that depend on avataaar_image