increment property

  1. @Input()
set increment (int value)

Increment of dropdown options in minutes.

Throws ArgumentError if value is less than 1 minute or greater than 12 hours or day divided by it is fractional.

Implementation

@Input()
set increment(int value) {
  if (value < 1) {
    throw ArgumentError('increment must not be less than 1 minute');
  } else if (minutesInDay % value != 0) {
    throw ArgumentError('day divided by increment must not be fractional');
  } else if (minutesInDay ~/ value < 2) {
    throw ArgumentError('increment must not be greater than 12 hours');
  }

  _increment = value;

  timeOptions =
      TimeSelectionOptions(_generateTimeOptions(_increment, utc: _utc));
}