搜索插件、代码仓与 APP 分类

avatar_plus 封面
插件详情v0.0.5

avatar_plus

一个功能强大的 Flutter 包,用于生成和显示带有随机字符串内容的可自定义头像。非常适合用户资料、占位符等场景。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1000
喜欢数
54
Pub 分数
140

安装插件

flutter pub add avatar_plus

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Avatar Plus 是一个 Flutter 包,旨在使用随机字符串内容生成和显示可自定义头像。它支持多种视觉风格,非常适合用户个人资料、聊天界面和占位符图像。该包可在多个平台上无缝集成,提供外观上的灵活性和易用性。通过最少的设置,开发者可以快速实现动态头像,以适应不同的上下文和设计需求。

适合场景

  • 用户个人资料图片
  • 聊天头像显示
  • 占位符图像
  • 仪表板用户指标
  • 入门屏幕
  • 团队成员卡片

主要特点

  • 基于随机字符串的头像生成
  • 可自定义的形状和颜色
  • 对多个平台的支持
  • 与 Flutter 的轻松集成
  • 可配置的文本和首字母
  • 响应式设计

适合对象

  • 需要快速头像的应用开发者
  • 寻求一致的个人资料视觉效果的UI设计师
  • 具有动态用户数据的项目
  • 跨平台应用程序
  • 原型设计和最小可行产品开发

使用建议

  • 限于文本类头像
  • 无内置图像上传支持
  • 依赖字符串输入以确保唯一性
  • 可能需要自定义样式以实现复杂设计
  • 未针对大规模头像库进行优化

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

pub package package publisher GitHub code size

Avatar Plus

Avatar Plus is a Flutter wrapper for Multiavatar that allows you to generate and customize unique avatars easily. With up to 12 billion unique avatars possible, this package is perfect for creating profile pictures, gaming logos, or adding personalized touches to your design projects.

Features

  • Generate Unique Avatars: Create avatars based on any text input with just a click or a keyboard shortcut.
  • Customizable: Integrate and customize avatars in your Flutter applications.
  • Randomized Associations: Names and words are randomly assigned to avatars, ensuring each one is unique.
  • Free to Use: Use any generated avatar freely across various applications.

Demo

'Screen 1' 'Screen 3' 'Screen 2'

Sample Code

Here is a basic example demonstrating how to use the avatar_plus package with various customization options:

AvatarPlus("Jonny")            

Installation

Add the following line to your pubspec.yaml file under dependencies:

dependencies:
  avatar_plus: ^1.0.0

Then run:

flutter pub get

Usage

To use Avatar Plus in your Flutter application:

Import the Package
import 'package:avatar_plus/avatar_plus.dart';
Basic Example

Here's a simple example of how to generate an avatar using Avatar Plus:

import 'package:flutter/material.dart';
import 'package:avatar_plus/avatar_plus.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Avatar Plus example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const Example(),
    );
  }
}

class Example extends StatelessWidget {
  const Example({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      bottomNavigationBar: const Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisSize: MainAxisSize.min,
        children: [
          Text(
            "Avatar Plus",
            style: TextStyle(fontSize: 40),
          ),
          Text("Yudiz Solutions Limited © 2024"),
          SizedBox(
            height: 20,
          )
        ],
      ),
      body: Center(
        child: AvatarPlus(
          "jonny",
          height: MediaQuery.of(context).size.width - 20,
          width: MediaQuery.of(context).size.width - 20,
        ),
      ),
    );
  }
}
Additional Usage Examples

You can generate avatars in various formats using Avatar Plus:

1. Get Avatar as a String
String svgCode = AvatarPlusGen.instance.generate("Jonny");
2. Get Avatar String with Transparent Background
String svgCode = AvatarPlusGen.instance.generate("Jonny", trBackground: true);
3. Get Avatar as an SVG Widget
Widget svgWidget = AvatarPlus("Jonny", height: 100, width: 100);
4. Get Avatar SVG Widget with Transparent Background
Widget svgWidget = AvatarPlus("Jonny", trBackground: true, height: 100, width: 100);

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributors

All Contributors

YudizAndroidNaresh
YudizAndroidNaresh

🚇 ⚠️ 💻

Contributions

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository if you would like to contribute to Avatar Plus.

Support

If you encounter any issues or have questions, feel free to open an issue on GitHub.

Visitors Count

Loading

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。