You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
flutter_custom_calendar/lib/cache_data.dart

30 lines
573 B

4 years ago
import 'model/date_model.dart';
/**
*
*/
class CacheData {
//私有构造函数
CacheData._();
3 years ago
static CacheData? _instance;
3 years ago
static CacheData? get instance => _instance;
3 years ago
Map<DateModel, List<DateModel>?> monthListCache = Map();
4 years ago
Map<DateModel, List<DateModel>> weekListCache = Map();
3 years ago
static CacheData? getInstance() {
if (_instance == null) {
_instance = new CacheData._();
}
return _instance;
}
4 years ago
void clearData() {
monthListCache.clear();
weekListCache.clear();
}
}