2026-02-25 11:18:28 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2026-03-18 13:35:25 +08:00
|
|
|
import 'package:go_router/go_router.dart';
|
2026-02-25 11:18:28 +08:00
|
|
|
import '../../../../core/theme/design_tokens.dart';
|
2026-03-18 13:35:25 +08:00
|
|
|
import '../../../../shared/widgets/app_toggle_switch.dart';
|
|
|
|
|
import '../widgets/settings_page_scaffold.dart';
|
2026-02-25 11:18:28 +08:00
|
|
|
|
|
|
|
|
class FeaturesScreen extends StatefulWidget {
|
|
|
|
|
const FeaturesScreen({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<FeaturesScreen> createState() => _FeaturesScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _FeaturesScreenState extends State<FeaturesScreen> {
|
|
|
|
|
bool _dailyReminderEnabled = true;
|
|
|
|
|
bool _dailySummaryEnabled = false;
|
|
|
|
|
bool _weeklyReportEnabled = true;
|
|
|
|
|
bool _weeklyDigestEnabled = false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2026-03-18 13:35:25 +08:00
|
|
|
return SettingsPageScaffold(
|
|
|
|
|
title: '周期计划',
|
|
|
|
|
onBack: () => context.pop(),
|
|
|
|
|
body: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
_buildSectionTitle('每日'),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
_buildDailyList(),
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
_buildSectionTitle('每周'),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
_buildWeeklyList(),
|
|
|
|
|
],
|
2026-02-25 11:18:28 +08:00
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildSectionTitle(String title) {
|
|
|
|
|
return Text(
|
|
|
|
|
title,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: AppColors.slate500,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildDailyList() {
|
|
|
|
|
return Column(
|
2026-03-18 13:35:25 +08:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
2026-02-25 11:18:28 +08:00
|
|
|
children: [
|
|
|
|
|
_buildFeatureCard(
|
|
|
|
|
icon: Icons.alarm,
|
|
|
|
|
iconColor: const Color(0xFF14B8A6),
|
|
|
|
|
iconBg: const Color(0xFFECFEFF),
|
|
|
|
|
iconBorder: const Color(0xFFC9F4F2),
|
|
|
|
|
title: '会议提醒',
|
|
|
|
|
subtitle: '每次会议前 15 分钟提醒',
|
|
|
|
|
value: _dailyReminderEnabled,
|
|
|
|
|
onChanged: (v) => setState(() => _dailyReminderEnabled = v),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
|
_buildFeatureCard(
|
|
|
|
|
icon: Icons.summarize,
|
|
|
|
|
iconColor: const Color(0xFF2563EB),
|
|
|
|
|
iconBg: const Color(0xFFEEF6FF),
|
|
|
|
|
iconBorder: const Color(0xFFDCEAFF),
|
|
|
|
|
title: '每日摘要',
|
|
|
|
|
subtitle: '每天 18:00 发送当日摘要',
|
|
|
|
|
value: _dailySummaryEnabled,
|
|
|
|
|
onChanged: (v) => setState(() => _dailySummaryEnabled = v),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildWeeklyList() {
|
|
|
|
|
return Column(
|
2026-03-18 13:35:25 +08:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
2026-02-25 11:18:28 +08:00
|
|
|
children: [
|
|
|
|
|
_buildFeatureCard(
|
|
|
|
|
icon: Icons.calendar_view_week,
|
2026-03-02 16:34:33 +08:00
|
|
|
iconColor: AppColors.success,
|
2026-02-25 11:18:28 +08:00
|
|
|
iconBg: const Color(0xFFECFDF5),
|
|
|
|
|
iconBorder: const Color(0xFFCDEEDC),
|
|
|
|
|
title: '周报生成',
|
|
|
|
|
subtitle: '每周一自动生成周报',
|
|
|
|
|
value: _weeklyReportEnabled,
|
|
|
|
|
onChanged: (v) => setState(() => _weeklyReportEnabled = v),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
|
_buildFeatureCard(
|
|
|
|
|
icon: Icons.article,
|
2026-03-02 16:34:33 +08:00
|
|
|
iconColor: AppColors.warning,
|
2026-02-25 11:18:28 +08:00
|
|
|
iconBg: const Color(0xFFFFF7ED),
|
|
|
|
|
iconBorder: const Color(0xFFFDE6CD),
|
|
|
|
|
title: '每周摘要',
|
|
|
|
|
subtitle: '每周日发送本周活动汇总',
|
|
|
|
|
value: _weeklyDigestEnabled,
|
|
|
|
|
onChanged: (v) => setState(() => _weeklyDigestEnabled = v),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildFeatureCard({
|
|
|
|
|
required IconData icon,
|
|
|
|
|
required Color iconColor,
|
|
|
|
|
required Color iconBg,
|
|
|
|
|
required Color iconBorder,
|
|
|
|
|
required String title,
|
|
|
|
|
required String subtitle,
|
|
|
|
|
required bool value,
|
|
|
|
|
required ValueChanged<bool> onChanged,
|
|
|
|
|
}) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.all(14),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
2026-03-18 13:35:25 +08:00
|
|
|
border: Border.all(color: AppColors.borderSecondary),
|
2026-02-25 11:18:28 +08:00
|
|
|
),
|
|
|
|
|
child: Row(
|
2026-03-18 13:35:25 +08:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
2026-02-25 11:18:28 +08:00
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: iconBg,
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
border: Border.all(color: iconBorder),
|
|
|
|
|
),
|
|
|
|
|
child: Icon(icon, size: 18, color: iconColor),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 12),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: AppColors.slate900,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Text(
|
|
|
|
|
subtitle,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
color: AppColors.slate500,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
2026-03-18 13:35:25 +08:00
|
|
|
AppToggleSwitch(value: value, onChanged: onChanged),
|
2026-02-25 11:18:28 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|