setSelected method
Implementation
void setSelected(DateTime selected, {bool triggerEvents = true}) {
String textDate = new DateFormat('dd/MM/yyyy').format(selected);
setState(() {
selectedDate = selected;
_controller.text = textDate;
});
if (triggerEvents) {
if (widget.onChanged != null) {
widget.onChanged!(textDate);
}
if (widget.onSelect != null) {
widget.onSelect!(selected);
}
}
}