previous method

AvataaarFacialHair previous([
  1. Color? color
])

Implementation

AvataaarFacialHair previous([Color? color]) {
  final i = toIndex();
  final nextI = (i - 1) < 0 ? (all.length - 1) : (i - 1);
  final e = AvataaarFacialHair.fromIndex(nextI);

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