Flutter wrapper widget for Avataaars API

Overview

Flutter_avataaar

pub package

Flutter wrapper widget for Avataaars API - a free online avatar generator for anyone to make their beautiful personal avatar easily.

flutter-avataaar

Getting Started

  1. Create Avataaar object:
// Create avatar with default constructor
Avataaar(
  skin: Skin.pale,
  style: Style.circle,
  top: Top.longHairCurly(
    accessoriesType: AccessoriesType.Round,
    facialHair: FacialHair.beardMagestic(
      facialHairColor: FacialHairColor.BlondeGolden,
    ),
  ),
);

// Randomize all properties
Avataaar.random();

// Or mix both
Avataaar.random(
  skin: Skin.pale,
  style: Style.circle,
  top: Top.longHairCurly(
    accessoriesType: AccessoriesType.Round,
    facialHair: FacialHair.random,
  ),
);
  1. Create AvataaarGenerator widget and pass it the avatar:
AvataaarImage(
  avataaar: avataaar,
  onTranslateKey: (String key) {
  return Translate.get(key);
  }
  onChangeAvataaar:() {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) {
    // ...
  },
)

Persisting avatars

Use Avataaar.toJson() and Avataaar.fromJson(String) methods to serialize/deserialize avatars.

Getting image bytes

Use the funtion getPngFromSvg from the class Avataaar to get the File.

You might also like...

Beautiful Weather App using API with support for dark mode. Created by Jakub Sobański ( API ) and Martin Gogołowicz (UI, API help)

Beautiful Weather App using API with support for dark mode. Created by Jakub Sobański ( API ) and Martin Gogołowicz (UI, API help)

Flutter Weather App using API with darkmode support Flutter 2.8.1 Null Safety Beautiful Weather App using https://github.com/MonsieurZbanowanYY/Weathe

Nov 29, 2022

Howl.js wrapper for Flutter

flutter_web_howl Howl.js wrapper for Flutter https://pub.dev/packages/flutter_web_howl You can now include Howl.js using initializeHowl() anywhere in

Feb 8, 2022

A wrapper on top of alert dialog provided by flutter.

A wrapper on top of alert dialog provided by flutter.

material_dialog A wrapper on top of alert dialog provided by flutter. Demo Use this package as a library 1. Depend on it Add this to your package's pu

Aug 8, 2022

A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.

A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.

Ably Flutter Plugin A Flutter plugin wrapping the ably-cocoa (iOS) and ably-java (Android) client library SDKs for Ably, the platform that powers sync

Dec 13, 2022

A convenience wrapper for building Flutter apps with PDFTron mobile SDK.

A convenience wrapper for building Flutter apps with PDFTron mobile SDK.

About PDFTron Flutter PDFTron's Flutter PDF library brings smooth, flexible, and stand-alone document viewing and editing solutions using Flutter code

Dec 26, 2022

A wrapper for a Flutter ScrollView which enables lazy loading

Lazy load scrollview A wrapper for a ScrollView that will enable lazy loading Usage Add lazy_load_scrollview dependency to your pubspec.yaml: dependen

Nov 7, 2022

Easy nav - A simple wrapper around flutter navigator, dialogs and snackbar to do those things without context

EasyNav Just a simple wrapper around flutter navigator, dialogs and snackbar to

Feb 26, 2022

A simple typewriter text animation wrapper for flutter.

A simple typewriter text animation wrapper for flutter.

A simple typewriter text animation wrapper for flutter, supports iOS, Android, web, Windows, macOS, and Linux.

Jun 1, 2022

RoomKit Flutter is a wrapper of Native Android and iOS RoomKit SDK

RoomKit Flutter is a wrapper of Native Android and iOS RoomKit SDK

ZEGOCLOUD RoomKit Flutter RoomKit Flutter is a wrapper of Native Android and iOS RoomKit SDK Getting started Prerequisites Basic requirements Android

Dec 16, 2022
Comments
  • How to rename the name of the image ?

    How to rename the name of the image ?

    Hello , Thank you for creating such a great library.

    experimenting with plugin and got to know that when download the image , it gets store like c9b30e8d-92d5-4575-a552-4a7f8e62a72c.png

    is there any option to set name for the image as need to implement the functionality

    opened by monikkacha 1
  • The baseUrl parameter on AvataaarPicture.builder doesn't do anything.

    The baseUrl parameter on AvataaarPicture.builder doesn't do anything.

    AvataaarPicture.builder's baseUrl parameter is just completely ignored and the baseUrl parameter from the given avatar is used.

    BTW thanks for this package!

    opened by joranmulderij 1
  • Persisting avatars crash

    Persisting avatars crash

    When using persisting avatars, it had an error

    E/flutter (12446): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type '() => TopType?' is not a subtype of type '(() => TopType)?' of 'orElse'
    

    To repoduce this juste put this in the main:

    Avataaar.fromMap(Avataaar.random().toMap());
    

    This is a good fix because now it work xD

    opened by execrate0 0
Owner
null
Federico 1 Feb 3, 2022
A MangaDex API wrapper for Dart/Flutter

A MangaDex API wrapper for Dart Usage A simple usage example: import 'package:mangadex_api/mangadex_api.dart'; main() { var client = MDClient();

Matyáš Caras 4 Dec 2, 2022
The lightweight and powerful wrapper library for Twitter Ads API written in Dart and Flutter 🐦

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Twitter.dart 2 Aug 26, 2022
An unofficial wrapper for the kdecole api

This is an UNOFFICIAL wrapper for the kdecole api How to use ? Login First, you need to create a Client() object : LOGIN AND PASSWORD ARE NOT YOUR ENT

null 5 Nov 2, 2022
A most easily usable Duolingo API wrapper in Dart. Duolingo4D is an open-sourced Dart library.

A most easily usable Duolingo API wrapper in Dart! 1. About Duolingo4D Duolingo4D is an open-sourced Dart library. With Duolingo4D, you can easily int

Kato Shinya 18 Oct 17, 2022
A Dart wrapper of the SMHI Open Data API

SMHI Open Data for Dart This package is in early development and some features may not work as intended. If so, feel free to submit a pull request. A

Lukas 1 Sep 19, 2022
An api wrapper for FortniteApi.io in dart.

Fortnite An api wrapper for FortniteApi.io in dart. Installation Add this to your package's pubspec.yaml file: dependencies: fortnite_api_io: any

Vanxh 3 Jan 29, 2022
DiceBear API wrapper. DiceBear is an avatar library for designers and developers. Generate random avatar profile pictures!

dice_bear Flutter Package DiceBear API wrapper. DiceBear is an avatar library for designers and developers. Generate random avatar profile pictures! C

Zaif Senpai 8 Oct 31, 2022
Dart wrapper for mpesa daraja api by safaricom

mpesa-daraja-plugin-flutter-dart dart wrapper for mpesa daraja api by safaricom Features [Done]Lipa na mpesa [x] [inprogress] C2B [inprogress] B2B [in

Anselmo.Jr 11 Nov 6, 2022
Bhagavad Gita app using flutter & Bhagavad-Gita-API is A lightweight Node.js based Bhagavad Gita API [An open source rest api on indian Vedic Scripture Shrimad Bhagavad Gita].

Gita Bhagavad Gita flutter app. Download App - Playstore Web Application About Bhagavad Gita app using flutter & Bhagavad-Gita-API is A lightweight No

Ravi Kovind 7 Apr 5, 2022