From f812e4b84d203eb3bc6bca8dc55d1482449ed669 Mon Sep 17 00:00:00 2001 From: LXD312569496 <450468291@qq.com> Date: Tue, 5 Nov 2019 18:37:57 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug=EF=BC=9A=E5=8A=A0=E5=85=A5=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E4=BB=A3=E7=A0=81=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/widget/month_view.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/widget/month_view.dart b/lib/widget/month_view.dart index 2d89aa8..08815ed 100644 --- a/lib/widget/month_view.dart +++ b/lib/widget/month_view.dart @@ -51,8 +51,9 @@ class _MonthViewState extends State items = CacheData.getInstance().monthListCache[firstDayOfMonth]; } else { LogUtil.log(TAG: this.runtimeType, message: "缓存中无数据"); - getItems(); - CacheData.getInstance().monthListCache[firstDayOfMonth] = items; + getItems().then((_){ + CacheData.getInstance().monthListCache[firstDayOfMonth] = items; + }); } lineCount = DateUtil.getMonthViewLineCount(widget.year, widget.month); @@ -68,7 +69,7 @@ class _MonthViewState extends State }); } - getItems() async { + Future getItems() async { items = await compute(initCalendarForMonthView, { 'year': widget.year, 'month': widget.month,