Range.between constructor

Range.between(
  1. int from,
  2. int to
)

Obtains a range with the specified minimum and maximum values.

The from parameter must be less than to parameter, otherwise ArgumentError will be thrown.

Implementation

factory Range.between(final int from, final int to) {
  if (from > to) {
    throw ArgumentError('The "from" parameter must be less than "to".');
  }

  return Range._(from, to);
}