AvataaarFacialHair.fromIndex constructor

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

creates AvataaarFacialHair based on the index found in AvataaarFacialHair.all

Implementation

factory AvataaarFacialHair.fromIndex(int index, [Color? color]) {
  final e = AvataaarFacialHair.all.elementAt(index);
  if (color != null) {
    return e.copyWith(color: color);
  }
  return e;
}