fix: 修复 release 构建失败(theme 未定义 / _refreshBackground 残留)
This commit is contained in:
6 files changed
+48
-11
No files matched your search
@@ -1,5 +1,3 @@
|
||||
import 'dart:ui' show FontFeature;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 服务器卡片的数据状态。
|
||||
@@ -252,6 +250,7 @@ class ServerCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildMetrics(BuildContext context, ColorScheme scheme) {
|
||||
final theme = Theme.of(context);
|
||||
final online = state == ServerCardState.online;
|
||||
|
||||
if (state == ServerCardState.loading) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:path_provider/path_provider.dart';
|
||||
import '../../core/theme/app_theme.dart';
|
||||
import '../../core/utils/update_service.dart';
|
||||
import '../../core/utils/background_service.dart';
|
||||
import '../../core/widgets/background_widget.dart';
|
||||
import '../../providers/theme_provider.dart';
|
||||
import '../../providers/wallpaper_provider.dart';
|
||||
|
||||
@@ -161,7 +162,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
|
||||
return destPath;
|
||||
} catch (e) {
|
||||
print('保存失败: $e');
|
||||
debugPrint('保存失败: $e');
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('保存失败,请重试')),
|
||||
@@ -255,7 +256,8 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
onChanged: (value) async {
|
||||
await BackgroundService.setVideoSound(value);
|
||||
setState(() => _videoSoundEnabled = value);
|
||||
_refreshBackground();
|
||||
// 立即应用到正在播放的背景视频,无需重建图层
|
||||
backgroundWidgetKey.currentState?.applyVideoSound(value);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user