getWidget method

dynamic getWidget(
  1. Size size
)

Implementation

getWidget(Size size) {
  final type = this.type ?? defaultBoringAvatarsType;
  switch (type) {
    case BoringAvatarsType.bauhaus:
      return AnimatedAvatarBauhaus(
          name: name,
          colors: colors,
          size: size,
          onEnd: onEnd,
          curve: curve,
          duration: duration);
    case BoringAvatarsType.marble:
      return AnimatedAvatarMarble(
          name: name,
          colors: colors,
          size: size,
          onEnd: onEnd,
          curve: curve,
          duration: duration);
    case BoringAvatarsType.beam:
      return AnimatedAvatarBeam(
          name: name,
          colors: colors,
          size: size,
          onEnd: onEnd,
          curve: curve,
          duration: duration);
    case BoringAvatarsType.pixel:
      return AnimatedAvatarPixel(
          name: name,
          colors: colors,
          size: size,
          onEnd: onEnd,
          curve: curve,
          duration: duration);
    case BoringAvatarsType.ring:
      return AnimatedAvatarRing(
          name: name,
          colors: colors,
          size: size,
          onEnd: onEnd,
          curve: curve,
          duration: duration);
    case BoringAvatarsType.sunset:
      return AnimatedAvatarSunset(
          name: name,
          colors: colors,
          size: size,
          onEnd: onEnd,
          curve: curve,
          duration: duration);
  }
}