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

fluttermoji 封面
插件详情v1.0.2

fluttermoji

一个轻量级且高度可定制的 SVG 头像库,适用于 Flutter 应用。提供可自定义的 Widget、CircleAvatar 以及其他即开即用的实用功能。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
657
喜欢数
318
Pub 分数
150

安装插件

flutter pub add fluttermoji

插件介绍

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

Fluttermoji 是一个轻量级、可自定义的基于 SVG 的 Flutter 头像库,旨在简化个人资料图片和聊天头像的创建。它提供了一个 Customizer Widget 用于动态生成头像,一个 CircleAvatar 实现,以及可无缝集成到应用中的实用函数。该库具有良好的可扩展性,支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台。该库使开发者能够使用最少的代码轻松生成独特的 SVG 头像,非常适合社交应用、消息界面或用户资料。

适合场景

  • 用户资料头像
  • 消息应用聊天头
  • 社交媒体应用UI
  • 入门屏幕
  • 多用户仪表板

主要特点

  • 基于SVG的头像渲染
  • 用于实时自定义的自定义工具
  • CircleAvatar 集成
  • 跨平台支持
  • 高度可定制的外观
  • 轻量且快速的性能

适合对象

  • 开发社交或消息应用的开发者
  • 需要品牌头像的团队
  • 需要动态用户资料视觉效果的应用程序
  • 专注于性能和最小包大小的项目

使用建议

  • 需要具备基本的SVG知识
  • 仅限头像特定用途
  • 可能需要额外的样式来处理复杂的用户界面
  • 不适合非头像图形

原始 README

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

fluttermoji

Pub Version Generic badge GitHub stars GitHub stars

A light-weight and highly customizable SVG graphic set for Flutter, which provides a Customizer Widget, CircleAvatar and other utility functions.

This package provides you three easy-to-use widgets -

Name Description Screenshot
FluttermojiCircleAvatar Use your fluttermoji anywhere in your Flutter app with a simple customizable widget. Supports material dark theme too. 1608830483994
FluttermojiCustomizer A comprehensize UI to customize the user's fluttermoji. Offers previews of each individual component and whose looks can be tweaked with a FluttermojiThemeData 1608827561239
FluttermojiSaveWidget Renders a save button by default OR can be used as an [InkWell] wrapper for the [child] widget. 1608827561239

The appearance of the widgets can be tweaked with FluttermojiThemeData. It let's you change things like the customizer's background colours, the box decoration etc.


Use the given utility functions to send and receive Fluttermoji data from your server/DB efficiently.

Function Prototype Description
String decodeFluttermojifromString(String encodedData) Decode your string containing the attributes to a SVG and render it by enclosing this string with a SvgPicture.string()
Future<Map> encodeMySVGtoMap() Encodes the local user's fluttermoji to a Map denoting the selected attributes
Future<String> encodeMySVGtoString() Encodes the local user's fluttermoji to a Map denoting the selected attributes , and stringifies the result before returning the value.
Future<List> clearFluttermoji() Erases local user's fluttermoji SVG String and selection from local storage

SVG Assets used are derived from getavataaars.com .

Screenshots

Example app

Try out the demo on your browser now

Use them in your games or social media apps

Usage Instructions

  1. Depend on it by importing your package in the pubspec.yaml file.
    dependencies:
          fluttermoji: latest_version
    
  2. Add the following import to your .dart file
    import 'package:fluttermoji/fluttermoji.dart';
    
  3. Add the FluttermojiCircleAvatar widget to display your Fluttermoji where needed.
    FluttermojiCircleAvatar();
    
  4. To allow your users to personalize their Fluttermoji, add the following widget and pair it with the above one in your page.
    FluttermojiCustomizer();
    

That's all it takes, simple right ? The two widgets communicate with each other and update in real-time throughout your widget tree.

Usage Guidelines

The package offers a ton of features in the simplest way possible, however there are some points worth noting.

  • FluttermojiCircleAvatar only renders the local user's avatar. To display the avatar of other users', you'll have to use the SvgPicture.string() method from flutter_svg .
  • FluttermojiCircleAvatar would render a default avatar until customized and saved by the local user for the first time.
  • Use the canvaskit renderer when building for web, the default html renderer will not work with SVGs.
  • The fluttermoji's attributes are saved to local app/browser storage. Clearing app/browser data would mean clearing these attributes as well.
  • You can create a FluttermojiThemeData instance to configure the look and feel of the widgets to your liking.

Attributions

Community

If you find any issues or have some feedback, please raise the same on the GitHub repo or contact me directly.

Do leave a thumbs up if you liked it.

Happy Fluttering ; )

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

暂无相关数据。