onAlternativePresetClicked method
void
onAlternativePresetClicked(
- UIEvent? event,
- DatepickerPreset parent,
- DatepickerPreset alternative
Implementation
void onAlternativePresetClicked(
UIEvent? event, DatepickerPreset parent, DatepickerPreset alternative) {
// Replace parent preset with alternative in main menu.
for (var i = 0; i < _presets.length; i++) {
if (_presets[i] == parent) {
_presets[i] = alternative;
if (useMenuForPresets) _updateValidPresets(); // to refresh the menu
break;
}
}
onRangeClicked(event, alternative.range);
}