Avataaar class
Data class of your current avatar. Can generate a url using toUrl function as well as a png from svg getPngFromSvg
- Implemented types
Constructors
- Avataaar({String baseUrl = AvataaarsApi.baseUrl, required Top top, required Clothes clothes, required Eyes eyes, required Eyebrow eyebrow, required Mouth mouth, required Skin skin, required Style style, Color backgroundColor = AvataaarsApi.baseBackgroundColor})
-
Avataaar.fromMap(Map<
String, dynamic> map) -
Transform from map to Avataaar
factory
- Avataaar.random({String? baseUrl, Top? top, Clothes? clothes, Eyes? eyes, Eyebrow? eyebrow, Mouth? mouth, Skin? skin, Style? style, Color? backgroundColor})
- Generate a full random Avataaar. Could customize some values.
Properties
- backgroundColor ↔ Color
-
getter/setter pair
- baseUrl → String
-
final
- clothes → Clothes
-
final
- eyebrow → Eyebrow
-
final
- eyes → Eyes
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- mouth → Mouth
-
final
-
pieces
→ List<
AvataaarPart> -
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- skin → Skin
-
final
- style → Style
-
final
- top → Top
-
final
Methods
-
copyWith(
{Top? top, Clothes? clothes, Eyes? eyes, Eyebrow? eyebrow, Mouth? mouth, Skin? skin, Style? style, Color? backgroundColor}) → Avataaar -
getPngFromSvg(
{String? path, String? fileName, double? width, double? height, bool overrideFile = false}) → Future< File> - Get a png File from the current avataaar and storage it on the provided paths.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String - Encode to json
-
toMap(
) → Map< String, dynamic> - Transform from Avataaar to map
-
toString(
) → String -
A string representation of this object.
inherited
-
toUrl(
) → String - Create the url for the current Avataaar data with all parameters needed.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
-
cachedUrls
→ Map<
String, String> -
Cached urls to avoid multiple request
final
Constants
-
defaultBackgroundColors
→ const List<
Color> - List of colors used to randomize the background color.