FLUTTER ECOSYSTEM

xioxin/flutter_boring_avatars

지루한 아바타는 사용자 이름과 색상 팔레트를 기반으로 고유한 아바타를 생성할 수 있습니다.

flutter_boring_avatars 프로젝트 이미지
Stars
13
Forks
4
최근 푸시(UTC)
2026. 2. 6.
프로젝트 상태
활성
xioxin GitHub avatar
GITHUB User

xioxin ↗

China
언어DartC++CMakeRubySwiftCHTMLKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^6.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기
Github

flutter_boring_avatars

Pub Version (including pre-releases)

English | 中文

Features

Boring avatars can generate unique avatars based on the username and color palette.

This project is a Flutter implementation of Boring Avatars.

It differs from the original project in its implementation, using Canvas for rendering and adding transition animations.

Check out the Web Demo to experience the effect.

Screenshots

preview1.png

Installation

Add the dependency in your pubspec.yaml file:

dependencies:
  flutter_boring_avatars: any # or the latest version on Pub

Usage

Get a simple avatar

BoringAvatar(name: "Maria Mitchell", type: BoringAvatarType.marble);

Get an animated avatar that has a nice transition animation when the name changes

AnimatedBoringAvatar(
  name: "Maria Mitchell",
  type: BoringAvatarType.marble,
  duration: const Duration(milliseconds: 300),
)

Get an avatar with a custom color palette

final colorPalette = BoringAvatarPalette(Color(0xffA3A948), Color(0xffEDB92E), Color(0xffF85931), Color(0xffCE1836), Color(0xff009989));

BoringAvatar(name: "Maria Mitchell", palette: colorPalette);

Set default type and palette, applicable only for BoringAvatar and AnimatedBoringAvatar

build(context) {
  return DefaultBoringAvatarStyle(
    type: BoringAvatarType.marble, 
    palette: colorPalette,
    child: Column(
      children: [
        BoringAvatar(name: "Maria Mitchell"),
        BoringAvatar(name: "Alexis Brooks"),
        BoringAvatar(name: "Justin Gray"),
      ]
    ),
  );
}

Use ShapeBorder to control the avatar shape and add a border

BoringAvatar(
  name: "Maria Mitchell",
  type: BoringAvatarType.marble,
  shape: OvalBorder(), // or RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))
);

Use the avatar for Decoration, it also supports transition animations when used in AnimatedContainer

Container(
  decoration: BoringAvatarDecoration(
    avatarData: BoringAvatarData.generate(name: name),
  ),
);

Export the avatar as an image

final avatarData = BoringAvatarData.generate(name: name);
final image = await avatarData.toImage(size: const Size.square(256));
final pngByteData = await image.toByteData(format: ImageByteFormat.png);

Thanks

Thanks to the developers of Boring Avatars.

The example uses the beautiful palette project from Matt DesLauriers.

If you like this project, please give me a star.