为 audioplayers_android 模块单独设置 Java 1.8,其他模块保持 Java 17
This commit is contained in:
@@ -28,7 +28,6 @@ class AutoRefreshManager {
|
||||
Future<void> init() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
_isEnabled = prefs.getBool(_autoRefreshKey) ?? false;
|
||||
_debugLog('自动刷新初始化,状态: $_isEnabled');
|
||||
}
|
||||
|
||||
bool get isEnabled => _isEnabled;
|
||||
@@ -37,7 +36,6 @@ class AutoRefreshManager {
|
||||
_isEnabled = enabled;
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setBool(_autoRefreshKey, enabled);
|
||||
_debugLog('自动刷新状态已设置: $enabled');
|
||||
|
||||
if (enabled) {
|
||||
_startTimer();
|
||||
@@ -48,25 +46,21 @@ class AutoRefreshManager {
|
||||
|
||||
void setOnRefresh(VoidCallback? callback) {
|
||||
_onRefresh = callback;
|
||||
_debugLog('设置刷新回调');
|
||||
}
|
||||
|
||||
void _startTimer() {
|
||||
_stopTimer();
|
||||
_refreshTimer = Timer.periodic(_refreshInterval, (timer) {
|
||||
_debugLog('自动刷新触发');
|
||||
if (_onRefresh != null) {
|
||||
_onRefresh!();
|
||||
}
|
||||
});
|
||||
_debugLog('自动刷新定时器已启动');
|
||||
}
|
||||
|
||||
void _stopTimer() {
|
||||
if (_refreshTimer != null) {
|
||||
_refreshTimer!.cancel();
|
||||
_refreshTimer = null;
|
||||
_debugLog('自动刷新定时器已停止');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,11 +71,6 @@ class AutoRefreshManager {
|
||||
void dispose() {
|
||||
_stopTimer();
|
||||
_onRefresh = null;
|
||||
_debugLog('自动刷新管理器已释放');
|
||||
}
|
||||
|
||||
void _debugLog(String message) {
|
||||
if (kDebugMode) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +92,6 @@ class DebugInfoManager {
|
||||
Future<void> init() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
_isEnabled = prefs.getBool(_debugInfoKey) ?? false;
|
||||
_debugLog('调试信息初始化,状态: $_isEnabled');
|
||||
}
|
||||
|
||||
bool get isEnabled => _isEnabled;
|
||||
@@ -113,7 +101,6 @@ class DebugInfoManager {
|
||||
_isEnabled = enabled;
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setBool(_debugInfoKey, enabled);
|
||||
_debugLog('调试信息状态已设置: $enabled');
|
||||
|
||||
if (!enabled) {
|
||||
_messageNotifier.value = '';
|
||||
@@ -124,12 +111,10 @@ class DebugInfoManager {
|
||||
if (!_isEnabled) return;
|
||||
|
||||
_messageNotifier.value = message;
|
||||
_debugLog('显示调试信息: $message');
|
||||
|
||||
_messageTimer?.cancel();
|
||||
_messageTimer = Timer(const Duration(seconds: 2), () {
|
||||
_messageNotifier.value = '';
|
||||
_debugLog('调试信息已隐藏');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -176,11 +161,6 @@ class DebugInfoManager {
|
||||
void dispose() {
|
||||
_messageTimer?.cancel();
|
||||
_messageNotifier.value = '';
|
||||
_debugLog('调试信息管理器已清理');
|
||||
}
|
||||
|
||||
void _debugLog(String message) {
|
||||
if (kDebugMode) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +181,6 @@ class OfflineDataManager {
|
||||
|
||||
Future<void> init() async {
|
||||
await _loadCachedData();
|
||||
_debugLog('离线数据管理器初始化,缓存数量: ${_cachedPoetryList.length}');
|
||||
}
|
||||
|
||||
Future<bool> isOnline() async {
|
||||
@@ -273,7 +252,7 @@ class OfflineDataManager {
|
||||
|
||||
_cachedPoetryList.add(map);
|
||||
} catch (e) {
|
||||
_debugLog('解析缓存数据失败: $e');
|
||||
// 解析失败
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -320,12 +299,7 @@ class OfflineDataManager {
|
||||
updateTime: updateTime,
|
||||
);
|
||||
} catch (e) {
|
||||
_debugLog('转换为PoetryData失败: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void _debugLog(String message) {
|
||||
if (kDebugMode) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user