搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。