refactor(apps): 主题系统迁移至 ColorScheme + 扩展架构并支持 Dark Mode

This commit is contained in:
qzl
2026-03-27 19:07:39 +08:00
parent ecc1ec6ce4
commit ae29a8209b
146 changed files with 4301 additions and 3200 deletions
+27
View File
@@ -0,0 +1,27 @@
import 'dart:async';
import 'hybrid_cache_store.dart';
class CacheInvalidator {
final HybridCacheStore? _store;
final Set<String> _invalidated = <String>{};
CacheInvalidator({HybridCacheStore? store}) : _store = store;
void invalidate(String key) {
_invalidated.add(key);
final store = _store;
if (store != null) {
unawaited(store.remove(key));
}
}
void invalidateCalendarDay(DateTime date) {
final month = '${date.year}-${date.month.toString().padLeft(2, '0')}';
final day = '$month-${date.day.toString().padLeft(2, '0')}';
invalidate('calendar:day:$day');
invalidate('calendar:month:$month');
}
bool wasInvalidated(String key) => _invalidated.contains(key);
}