From ba084e6e6a92745645dcc8b7f5d5767f26fd70e4 Mon Sep 17 00:00:00 2001 From: xiaodong <450468291@qq.com> Date: Sat, 14 Mar 2020 22:12:07 +0800 Subject: [PATCH] =?UTF-8?q?[plcs#8888]=20=E5=8D=95=E7=82=B9=E8=A7=A6?= =?UTF-8?q?=E6=91=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/widget/month_view.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/widget/month_view.dart b/lib/widget/month_view.dart index e7b503d..db6a134 100644 --- a/lib/widget/month_view.dart +++ b/lib/widget/month_view.dart @@ -51,7 +51,7 @@ class _MonthViewState extends State items = CacheData.getInstance().monthListCache[firstDayOfMonth]; } else { LogUtil.log(TAG: this.runtimeType, message: "缓存中无数据"); - getItems().then((_){ + getItems().then((_) { CacheData.getInstance().monthListCache[firstDayOfMonth] = items; }); } @@ -227,13 +227,17 @@ class ItemContainerState extends State { } calendarProvider.selectedDateList.add(dateModel); } - configuration.calendarSelect(dateModel); + if (configuration.calendarSelect != null) { + configuration.calendarSelect(dateModel); + } //多选也可以弄这些单选的代码 calendarProvider.selectDateModel = dateModel; } else { calendarProvider.selectDateModel = dateModel; - configuration.calendarSelect(dateModel); + if (configuration.calendarSelect != null) { + configuration.calendarSelect(dateModel); + } //单选需要刷新上一个item if (calendarProvider.lastClickItemState != this) {