avatar_plus
一个功能强大的 Flutter 包,用于生成和显示带有随机字符串内容的可自定义头像。非常适合用户资料、占位符等场景。
Avatar Plus 是一个 Flutter 包,可让您轻松生成和自定义独特的头像。最多可生成 120 亿个独一无二的头像,该包非常适合创建个人资料图片、游戏标志或为您的设计项目增添个性化元素。
{"sdk":"flutter"}^3.0.3^2.0.0+1{"sdk":"flutter"}^4.0.0以下为英文项目原文快照,最新内容请访问 GitHub。
https://raw.githubusercontent.com/YudizAndroidNareshP/Avatar-Plus/main/screenshots/banner.png
pub package package publisher GitHub code size
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.
| https://raw.githubusercontent.com/YudizAndroidNareshP/Avatar-Plus/main/screenshots/demo.gif | https://raw.githubusercontent.com/YudizAndroidNareshP/Avatar-Plus/main/screenshots/screen-1.png | https://raw.githubusercontent.com/YudizAndroidNareshP/Avatar-Plus/main/screenshots/screen-2.png |
|---|---|---|
'Screen 1' |
'Screen 3' |
'Screen 2' |
Here is a basic example demonstrating how to use the avatar_plus package with various
customization options:
AvatarPlus("Jonny")
Add the following line to your pubspec.yaml file under dependencies:
dependencies:
avatar_plus: ^1.0.0
Then run:
flutter pub get
To use Avatar Plus in your Flutter application:
import 'package:avatar_plus/avatar_plus.dart';
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,
),
),
);
}
}
You can generate avatars in various formats using Avatar Plus:
String svgCode = AvatarPlusGen.instance.generate("Jonny");
String svgCode = AvatarPlusGen.instance.generate("Jonny", trBackground: true);
Widget svgWidget = AvatarPlus("Jonny", height: 100, width: 100);
Widget svgWidget = AvatarPlus("Jonny", trBackground: true, height: 100, width: 100);
This project is licensed under the MIT License - see the LICENSE file for details.
| YudizAndroidNaresh YudizAndroidNaresh 🚇 ⚠️ 💻 |
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.
If you encounter any issues or have questions, feel free to open an issue on GitHub.