AvataaarHair.fromIndex constructor

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

creates AvataaarHair based on the index found in AvataaarHair.all

Implementation

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

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