DateRangeEditorModel constructor
DateRangeEditorModel({
- DatepickerComparison? initialValue,
- Date? minDate,
- Date? maxDate,
- bool requireFullPeriods = false,
- bool basic = false,
- List<
ComparisonOption> supportedComparisonOptions = const [],
Implementation
DateRangeEditorModel(
{DatepickerComparison? initialValue,
Date? minDate,
Date? maxDate,
this.requireFullPeriods = false,
this.basic = false,
List<ComparisonOption> supportedComparisonOptions = const []})
: _ref = ObservableReference(initialValue) {
this.supportedComparisonOptions = (supportedComparisonOptions.isNotEmpty)
? supportedComparisonOptions
: defaultComparisonOptions;
this.minDate = minDate ?? Date.today();
this.maxDate = maxDate ?? Date.today();
_updateHasNextPrev(initialValue);
_updateValidComparisonOptions();
_disposer
..addFunction(_changes.close)
..addStreamSubscription(_ref.stream.listen(_setEverything))
..addStreamSubscription(range.stream.listen(_setPrimaryRange))
..addStreamSubscription(comparison.stream.listen(_setComparisonRange))
..addStreamSubscription(calendar.changes.listen(_onCalendarChange));
}