ez_circle_avatar 0.0.1
ez_circle_avatar: ^0.0.1 copied to clipboard
A simple Flutter package for creating circular avatars.
ez_circle_avatar #
A simple Flutter widget for displaying circular avatars with initials and a consistent,
automatically generated background color based on a name.
Perfect for quick integration when you need a basic avatar without extensive customization.
Features #
- Name-Based Initials & Consistent Colors: Generates initials and a consistent background color from a given name (handles single, first/last, and multiple names). The same name always produces the same color.
- Easy to Use: Just provide the name.
- Default Icon: Displays a
person_outlineicon when no name is provided. - Handles Name Variations: Trims leading/trailing spaces in names.
- Customizable: Uses the standard Flutter
CircleAvatarwidget, allowing further customization (size, border, etc.). - Available on pub.dev: ez_circle_avatar
Getting started #
-
Add the dependency:
flutter pub add ez_circle_avatar -
Import the package:
import 'package:ez_circle_avatar/ez_circle_avatar.dart';
Usage #
Displaying a basic avatar is as simple as this:
EzCircleAvatar(name: 'Jane Doe'), // Different name, different color
EzCircleAvatar(name: 'John'), // Handles single names
EzCircleAvatar(name: 'John David Doe'), // Handles multiple names
EzCircleAvatar(name: ''), // Handles empty name, will show a person_outline icon
Maintainer #
Contributing #
Contributions are welcome! Please feel free to open issues and submit pull requests.
License #
MIT