Avataaar.random constructor

Avataaar.random({
  1. String? baseUrl,
  2. Top? top,
  3. Clothes? clothes,
  4. Eyes? eyes,
  5. Eyebrow? eyebrow,
  6. Mouth? mouth,
  7. Skin? skin,
  8. Style? style,
  9. Color? backgroundColor,
})

Generate a full random Avataaar. Could customize some values.

Implementation

Avataaar.random({
  String? baseUrl,
  Top? top,
  Clothes? clothes,
  Eyes? eyes,
  Eyebrow? eyebrow,
  Mouth? mouth,
  Skin? skin,
  Style? style,
  Color? backgroundColor,
}) : this(
        baseUrl: baseUrl ?? AvataaarsApi.baseUrl,
        top: top ?? Top.random,
        clothes: clothes ?? Clothes.random,
        eyes: eyes ?? Eyes.random,
        eyebrow: eyebrow ?? Eyebrow.random,
        mouth: mouth ?? Mouth.random,
        skin: skin ?? Skin.random,
        style: style ?? Style.random,
        backgroundColor: backgroundColor ??
            defaultBackgroundColors[Random().nextInt(
              defaultBackgroundColors.length,
            )],
      );