|
|
@ -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,
|
|
|
|