AvataaarStyle.fromIndex constructor

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

creates AvataaarStyle based on the index found in AvataaarStyle.all

Implementation

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