修复问题:单选模式下多个日期被选中

去掉默认dispose会销毁数据,提供方法让用户手动销毁数据clearData
develop^2
LXD312569496 5 years ago committed by xiaodong
parent 21fdeb5595
commit ecd90edbc4

@ -502,6 +502,8 @@ class CalendarController {
monthList.clear();
weekList.clear();
calendarProvider.clearData();
calendarConfiguration.weekChangeListeners=null;
calendarConfiguration.monthChangeListeners=null;
}
}

@ -69,7 +69,7 @@ class _CalendarViewWidgetState extends State<CalendarViewWidget> {
@override
void dispose() {
widget.calendarController.clearData();
// widget.calendarController.clearData();
super.dispose();
}

@ -162,12 +162,13 @@ class ItemContainerState extends State<ItemContainer> {
dateModel = widget.dateModel;
isSelected = ValueNotifier(dateModel.isSelected);
WidgetsBinding.instance.addPostFrameCallback((callback) {
if (configuration.selectMode == CalendarConstants.MODE_SINGLE_SELECT &&
dateModel.isSelected) {
calendarProvider.lastClickItemState = this;
}
});
//
// WidgetsBinding.instance.addPostFrameCallback((callback) {
// if (configuration.selectMode == CalendarConstants.MODE_SINGLE_SELECT &&
// dateModel.isSelected) {
// calendarProvider.lastClickItemState = this;
// }
// });
}
/**

Loading…
Cancel
Save