plus method

int plus({
  1. int? max,
})

Implementation

int plus({int? max}) {
  if (max != null) {
    value = min(max, value + 1);
  } else {
    value++;
  }
  return value;
}