Provides the Interval class, a contiguous set of values.
If an Interval contains two values, it also contains all values between them. It may have an upper and lower bound, and those bounds may be open or closed.
##Install
pub global activate den # If you haven't already
den install interval##Usage
import'package:interval/interval.dart';
// Date intervalsvar activeDates =newInterval<DateTime>.closed(date1, date2);
if(activeDates.contains(newDateTime.now()) {
print('Item is active!');
}
// View selection modelvar slider =newSlider(interval:newInterval.closed(0, 100));
// ValidationclassRating {
finalint value;
Rating(this.value) {
if(!newInterval.closed(1, 5).contains(value)) {
thrownewArgumentError('ratings must be between 1 and 5');
}
}
}