fix bug:加入缓存的代码有问题

develop^2
LXD312569496 5 years ago committed by xiaodong
parent 17c2a74fbb
commit f812e4b84d

@ -51,8 +51,9 @@ class _MonthViewState extends State<MonthView>
items = CacheData.getInstance().monthListCache[firstDayOfMonth]; items = CacheData.getInstance().monthListCache[firstDayOfMonth];
} else { } else {
LogUtil.log(TAG: this.runtimeType, message: "缓存中无数据"); LogUtil.log(TAG: this.runtimeType, message: "缓存中无数据");
getItems(); getItems().then((_){
CacheData.getInstance().monthListCache[firstDayOfMonth] = items; CacheData.getInstance().monthListCache[firstDayOfMonth] = items;
});
} }
lineCount = DateUtil.getMonthViewLineCount(widget.year, widget.month); lineCount = DateUtil.getMonthViewLineCount(widget.year, widget.month);
@ -68,7 +69,7 @@ class _MonthViewState extends State<MonthView>
}); });
} }
getItems() async { Future getItems() async {
items = await compute(initCalendarForMonthView, { items = await compute(initCalendarForMonthView, {
'year': widget.year, 'year': widget.year,
'month': widget.month, 'month': widget.month,

Loading…
Cancel
Save