关怀模式
This commit is contained in:
@@ -27,6 +27,7 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() {
|
||||
final isDark = _themeController.isDarkMode;
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return Scaffold(
|
||||
backgroundColor: isDark
|
||||
? const Color(0xFF1A1A1A)
|
||||
@@ -34,16 +35,13 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
'桌面卡片设置',
|
||||
style: TextStyle(
|
||||
color: AppConstants.primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: TextStyle(color: primaryColor, fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: isDark ? const Color(0xFF2A2A2A) : Colors.white,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back, color: AppConstants.primaryColor),
|
||||
icon: Icon(Icons.arrow_back, color: primaryColor),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
),
|
||||
@@ -100,6 +98,7 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
}
|
||||
|
||||
Widget _buildSettingsGroup(String title, List<Widget> items, bool isDark) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: isDark ? const Color(0xFF2A2A2A) : Colors.white,
|
||||
@@ -122,7 +121,7 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppConstants.primaryColor,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -140,14 +139,15 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
ValueChanged<bool> onChanged,
|
||||
bool isDark,
|
||||
) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return ListTile(
|
||||
leading: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: AppConstants.primaryColor.withAlpha(10),
|
||||
color: primaryColor.withAlpha(10),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(icon, color: AppConstants.primaryColor, size: 20),
|
||||
child: Icon(icon, color: primaryColor, size: 20),
|
||||
),
|
||||
title: Text(
|
||||
title,
|
||||
@@ -167,20 +167,21 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
trailing: Switch(
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
activeThumbColor: AppConstants.primaryColor,
|
||||
activeThumbColor: primaryColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildIntervalItem(bool isDark) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return ListTile(
|
||||
leading: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: AppConstants.primaryColor.withAlpha(10),
|
||||
color: primaryColor.withAlpha(10),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(Icons.refresh, color: AppConstants.primaryColor, size: 20),
|
||||
child: Icon(Icons.refresh, color: primaryColor, size: 20),
|
||||
),
|
||||
title: Text(
|
||||
'更新间隔',
|
||||
@@ -213,7 +214,7 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
visualDensity: VisualDensity.compact,
|
||||
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return AppConstants.primaryColor;
|
||||
return primaryColor;
|
||||
}
|
||||
return isDark ? Colors.grey[700] : Colors.grey[200];
|
||||
}),
|
||||
@@ -230,11 +231,12 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
}
|
||||
|
||||
Widget _buildPreviewCard(bool isDark) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppConstants.primaryColor.withAlpha(90),
|
||||
color: primaryColor.withAlpha(90),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@@ -303,19 +305,17 @@ class _WidgetsPageState extends State<WidgetsPage> {
|
||||
}
|
||||
|
||||
Widget _buildActionButton(bool isDark) {
|
||||
final primaryColor = _themeController.currentThemeColor;
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('桌面卡片设置已保存'),
|
||||
backgroundColor: AppConstants.primaryColor,
|
||||
),
|
||||
SnackBar(content: Text('桌面卡片设置已保存'), backgroundColor: primaryColor),
|
||||
);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppConstants.primaryColor,
|
||||
backgroundColor: primaryColor,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
||||
Reference in New Issue
Block a user