Search packages, repositories and app categories

flutter_avataaar cover
Package detailsv0.1.14

flutter_avataaar

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

30-day downloads
48
Likes
28
Pub points
60

Install package

flutter pub add flutter_avataaar

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter wrapper widget that integrates with the Avataaars API to generate and display customizable avatar images. It simplifies the process of creating unique avatars with various facial features, clothing, accessories, and expressions. Ideal for profile pictures, chat heads, or user interfaces requiring personalized avatars. The package is lightweight and easy to implement, offering a consistent UI experience across platforms. It supports dynamic avatar generation based on user preferences without requiring external image assets.

Use cases

  • User profile avatars
  • Chat head displays
  • Game character customization
  • Onboarding screens
  • Interactive user interfaces

Key features

  • Dynamic avatar generation
  • Customizable facial features
  • Supports multiple clothing and accessories
  • Simple integration with Flutter
  • Lightweight and efficient

Suitable for

  • Apps needing user personalization
  • Social media platforms
  • Gaming apps
  • Onboarding flows
  • UI components requiring avatars

Considerations

  • Relies on external Avataaars API
  • Limited to predefined avatar styles
  • No offline avatar generation
  • Dependent on network for image fetching
  • May require caching for performance

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter_avataaar

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

flutter-avataaar

Getting Started

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

// Randomize all properties
Avataaar.random();

// Or mix both
Avataaar.random(
  skin: Skin.pale,
  top: Top(
    topType: TopType.longHairCurvy,
    accessoriesType: AccessoriesType.Round,
    facialHair: FacialHair.random,
  ),
);
  1. Create AvataaarGenerator widget and pass it the avatar:
AvataaarGenerator
(
  avataaar: avataaar,
  onTranslateKey: (String key) {
  return Translate.get(key);
  }
  onUpdateAvataaar:() {setState((){});},
);

// By default package will use SvgPicture to render the image. AvataaarPicture could be used to create a custom
// [builder] constructor and create widget for given image url:
 AvataaarPicture.builder(
  builder: (context, avataaar) {
    // ...
  },
)
Persisting avatars

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

Getting image bytes

Use the funtion getPngFromSvg from the class Avataaar to get the png File.

Categories

Dependencies

Dependency list 7 items

Source repository

Projects using this package

No data available yet.