AvataaarClothes.fromIndex constructor

AvataaarClothes.fromIndex(
  1. int index, [
  2. Color? color
])

creates AvataaarClothes based on the index found in AvataaarClothes.all

Implementation

factory AvataaarClothes.fromIndex(int index, [Color? color]) {
  final e = AvataaarClothes.all.elementAt(index);

  if (color != null) {
    return e.copyWith(color: color);
  }
  return e;
}