v0.1.14flutter_avataaar
用於 Avataaars API 的 Flutter 包裝器小部件,可產生並顯示頭像圖像。
28喜歡 73近 30 天下載60Pub 分數
平台暫無資料
frananleo/flutter_avataaar open-source repository details.
{"sdk":"flutter"}^3.1.0^3.1.2^1.0.0^0.13.4^3.0.4^2.0.4^2.0.9^1.0.1以下為英文專案原文快照,最新內容請造訪 GitHub。
Flutter wrapper widget for Avataaars API - a free online avatar generator for anyone to make their beautiful personal avatar easily.
flutter-avataaar
// Create avatar with default constructor
Avataaar(
skin: Skin.pale,
top: Top(
topType: TopType.longHairCurvy,
accessoriesType: AccessoriesType.Round,
facialHair: FacialHair.beardMagestic(
facialHairColor: FacialHairColor.BlondeGolden,
),
),
);
// Randomize all properties
Avataaar.random();
// Or mix both
Avataaar.random(
skin: Skin.pale,
top: Top(
topType: TopType.longHairCurvy,
accessoriesType: AccessoriesType.Round,
facialHair: FacialHair.random,
),
);
AvataaarGenerator
(
avataaar: avataaar,
onTranslateKey: (String key) {
return Translate.get(key);
}
onUpdateAvataaar:() {setState((){});},
);
// By default package will use SvgPicture to render the image. AvataaarPicture could be used to create a custom
// [builder] constructor and create widget for given image url:
AvataaarPicture.builder(
builder: (context, avataaar) {
// ...
},
)
Use Avataaar.toJson() and Avataaar.fromJson(String) methods to serialize/deserialize avatars.
Use the funtion getPngFromSvg from the class Avataaar to get the png File.