关怀模式

This commit is contained in:
Developer
2026-04-02 22:30:49 +08:00
parent 09fee0694c
commit 7872f2e78a
70 changed files with 4884 additions and 2752 deletions

View File

@@ -205,7 +205,7 @@ class _AppDataPageState extends State<AppDataPage> {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: const Text('配置数据已清空,请重新启动应用'),
backgroundColor: AppConstants.primaryColor,
backgroundColor: _themeController.currentThemeColor,
duration: const Duration(seconds: 3),
),
);
@@ -348,7 +348,7 @@ class _AppDataPageState extends State<AppDataPage> {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: const Text('缓存已清空'),
backgroundColor: AppConstants.primaryColor,
backgroundColor: _themeController.currentThemeColor,
),
);
}
@@ -415,7 +415,7 @@ class _AppDataPageState extends State<AppDataPage> {
title.contains('⚠️') ? Icons.warning : Icons.help_outline,
color: title.contains('⚠️')
? Colors.orange
: AppConstants.primaryColor,
: _themeController.currentThemeColor,
),
const SizedBox(width: 8),
Expanded(child: Text(title, style: const TextStyle(fontSize: 18))),
@@ -432,7 +432,7 @@ class _AppDataPageState extends State<AppDataPage> {
style: ElevatedButton.styleFrom(
backgroundColor: title.contains('危险') || title.contains('再次')
? Colors.red
: AppConstants.primaryColor,
: _themeController.currentThemeColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
@@ -489,7 +489,7 @@ class _AppDataPageState extends State<AppDataPage> {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(message),
backgroundColor: AppConstants.primaryColor,
backgroundColor: _themeController.currentThemeColor,
),
);
}
@@ -498,6 +498,7 @@ class _AppDataPageState extends State<AppDataPage> {
Widget build(BuildContext context) {
return Obx(() {
final isDark = _themeController.isDarkMode;
final primaryColor = _themeController.currentThemeColor;
return Scaffold(
backgroundColor: isDark
@@ -508,9 +509,7 @@ class _AppDataPageState extends State<AppDataPage> {
'应用数据',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
backgroundColor: isDark
? const Color(0xFF2A2A2A)
: AppConstants.primaryColor,
backgroundColor: isDark ? const Color(0xFF2A2A2A) : primaryColor,
iconTheme: IconThemeData(color: Colors.white),
),
body: _isLoading
@@ -551,14 +550,14 @@ class _AppDataPageState extends State<AppDataPage> {
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
color: _themeController.currentThemeColor.withAlpha(10),
borderRadius: const BorderRadius.vertical(
top: Radius.circular(16),
),
),
child: Row(
children: [
Icon(Icons.storage, color: AppConstants.primaryColor),
Icon(Icons.storage, color: _themeController.currentThemeColor),
const SizedBox(width: 8),
const Text(
'数据概览',

View File

@@ -24,7 +24,7 @@ class _BeginnerPageState extends State<BeginnerPage>
'title': '首页功能',
'icon': Icons.home,
'emoji': '🏠',
'color': AppConstants.primaryColor,
'color': Colors.blue,
'features': [
'精美卡片展示',
'智能推荐:根据时间和情景推荐合适的诗词',
@@ -271,6 +271,7 @@ class _BeginnerPageState extends State<BeginnerPage>
Widget build(BuildContext context) {
return Obx(() {
final isDark = _themeController.isDarkMode;
final primaryColor = _themeController.currentThemeColor;
return Scaffold(
backgroundColor: isDark ? const Color(0xFF1A1A1A) : Colors.grey[50],
body: Stack(
@@ -286,13 +287,13 @@ class _BeginnerPageState extends State<BeginnerPage>
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 17,
color: AppConstants.primaryColor,
color: primaryColor,
),
),
backgroundColor: isDark
? const Color(0xFF2A2A2A)
: Colors.white,
foregroundColor: AppConstants.primaryColor,
foregroundColor: primaryColor,
elevation: 0,
centerTitle: true,
floating: true,
@@ -301,7 +302,7 @@ class _BeginnerPageState extends State<BeginnerPage>
actions: [
IconButton(
icon: const Icon(Icons.help_outline),
color: AppConstants.primaryColor,
color: primaryColor,
onPressed: () {
Navigator.push(
context,
@@ -497,7 +498,7 @@ class _BeginnerPageState extends State<BeginnerPage>
Icon(
Icons.visibility_outlined,
size: 16,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
),
const SizedBox(width: 6),
Text(
@@ -505,7 +506,7 @@ class _BeginnerPageState extends State<BeginnerPage>
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
),
),
],
@@ -532,13 +533,13 @@ class _BeginnerPageState extends State<BeginnerPage>
width: 32,
height: 32,
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
color: _themeController.currentThemeColor.withAlpha(10),
borderRadius: BorderRadius.circular(8),
),
child: Icon(
Icons.book,
size: 18,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
),
),
const SizedBox(width: 10),
@@ -689,7 +690,7 @@ class _BeginnerPageState extends State<BeginnerPage>
width: 48,
height: 48,
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.2),
color: _themeController.currentThemeColor.withAlpha(20),
borderRadius: BorderRadius.circular(24),
),
child: const Center(
@@ -760,14 +761,14 @@ class _BeginnerPageState extends State<BeginnerPage>
color: isDark ? const Color(0xFF2A2A2A) : Colors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: AppConstants.primaryColor.withValues(alpha: 0.3),
color: _themeController.currentThemeColor.withAlpha(30),
),
),
child: Text(
text,
style: TextStyle(
fontSize: 12,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontWeight: FontWeight.w500,
),
),
@@ -812,7 +813,7 @@ class _BeginnerPageState extends State<BeginnerPage>
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
),
),
const SizedBox(height: 2),
@@ -873,12 +874,12 @@ class _BeginnerPageState extends State<BeginnerPage>
width: 8,
height: 40,
decoration: BoxDecoration(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: AppConstants.primaryColor.withValues(
alpha: 0.3,
color: _themeController.currentThemeColor.withAlpha(
30,
),
blurRadius: 8,
offset: const Offset(0, 2),
@@ -895,11 +896,11 @@ class _BeginnerPageState extends State<BeginnerPage>
duration: const Duration(milliseconds: 200),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: AppConstants.primaryColor.withValues(alpha: 0.2),
color: _themeController.currentThemeColor.withAlpha(20),
blurRadius: 4,
offset: const Offset(0, 2),
),

View File

@@ -41,6 +41,7 @@ class _PermissionPageState extends State<PermissionPage> {
Widget build(BuildContext context) {
return Obx(() {
final isDark = _themeController.isDarkMode;
final primaryColor = _themeController.currentThemeColor;
return Scaffold(
backgroundColor: isDark
? const Color(0xFF1A1A1A)
@@ -49,7 +50,7 @@ class _PermissionPageState extends State<PermissionPage> {
title: Text(
'权限管理',
style: TextStyle(
color: isDark ? Colors.white : AppConstants.primaryColor,
color: isDark ? Colors.white : primaryColor,
fontWeight: FontWeight.bold,
),
),
@@ -59,7 +60,7 @@ class _PermissionPageState extends State<PermissionPage> {
leading: IconButton(
icon: Icon(
Icons.arrow_back,
color: isDark ? Colors.white : AppConstants.primaryColor,
color: isDark ? Colors.white : primaryColor,
),
onPressed: () => Navigator.pop(context),
),
@@ -67,7 +68,7 @@ class _PermissionPageState extends State<PermissionPage> {
IconButton(
icon: Icon(
Icons.info_outline,
color: isDark ? Colors.white : AppConstants.primaryColor,
color: isDark ? Colors.white : primaryColor,
),
onPressed: _showPermissionInfoDialog,
),
@@ -118,6 +119,14 @@ class _PermissionPageState extends State<PermissionPage> {
null,
isDark,
),
_buildPermissionItem(
'设备标识',
'获取设备唯一标识',
Icons.person,
_clipboardEnabled,
null,
isDark,
),
], isDark),
const SizedBox(height: 16),
_buildPermissionGroup('权限说明', [
@@ -126,6 +135,7 @@ class _PermissionPageState extends State<PermissionPage> {
_buildInfoItem('剪切板', '用于复制诗词内容,方便用户分享和记录。', isDark),
_buildInfoItem('播放声音', '用于主页点击提示音,提升用户体验。', isDark),
_buildInfoItem('分享能力', '用于分享诗词内容到社交媒体平台。', isDark),
_buildInfoItem('设备标识', '用于唯一标识设备,确保用户数据安全。', isDark),
], isDark),
const SizedBox(height: 16),
_buildSandboxInfoCard(isDark),
@@ -161,14 +171,14 @@ class _PermissionPageState extends State<PermissionPage> {
children: [
Icon(
Icons.security,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
size: 20,
),
const SizedBox(width: 8),
Text(
title,
style: TextStyle(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontSize: 16,
fontWeight: FontWeight.bold,
),
@@ -199,10 +209,14 @@ class _PermissionPageState extends State<PermissionPage> {
width: 40,
height: 40,
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
color: _themeController.currentThemeColor.withAlpha(10),
borderRadius: BorderRadius.circular(12),
),
child: Icon(icon, color: AppConstants.primaryColor, size: 20),
child: Icon(
icon,
color: _themeController.currentThemeColor,
size: 20,
),
),
const SizedBox(width: 12),
Expanded(
@@ -271,7 +285,7 @@ class _PermissionPageState extends State<PermissionPage> {
height: 4,
margin: const EdgeInsets.only(top: 6),
decoration: BoxDecoration(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
borderRadius: BorderRadius.circular(2),
),
),
@@ -325,12 +339,16 @@ class _PermissionPageState extends State<PermissionPage> {
padding: const EdgeInsets.all(16),
child: Row(
children: [
Icon(Icons.build, color: AppConstants.primaryColor, size: 20),
Icon(
Icons.build,
color: _themeController.currentThemeColor,
size: 20,
),
const SizedBox(width: 8),
Text(
'项目补充完善',
style: TextStyle(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontSize: 16,
fontWeight: FontWeight.bold,
),
@@ -389,10 +407,14 @@ class _PermissionPageState extends State<PermissionPage> {
width: 40,
height: 40,
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
color: _themeController.currentThemeColor.withAlpha(10),
borderRadius: BorderRadius.circular(12),
),
child: Icon(icon, color: AppConstants.primaryColor, size: 20),
child: Icon(
icon,
color: _themeController.currentThemeColor,
size: 20,
),
),
const SizedBox(width: 12),
Expanded(
@@ -435,7 +457,7 @@ class _PermissionPageState extends State<PermissionPage> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
title: Row(
children: [
Icon(Icons.feedback, color: AppConstants.primaryColor),
Icon(Icons.feedback, color: _themeController.currentThemeColor),
const SizedBox(width: 8),
const Text('用户反馈'),
],
@@ -456,7 +478,7 @@ class _PermissionPageState extends State<PermissionPage> {
TextSpan(
text: '情景诗词',
style: TextStyle(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontWeight: FontWeight.bold,
),
),
@@ -469,7 +491,7 @@ class _PermissionPageState extends State<PermissionPage> {
'记得五星好评 ⭐',
style: TextStyle(
fontSize: 14,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontWeight: FontWeight.w500,
),
),
@@ -480,7 +502,7 @@ class _PermissionPageState extends State<PermissionPage> {
onPressed: () => Navigator.pop(context),
child: Text(
'确定',
style: TextStyle(color: AppConstants.primaryColor),
style: TextStyle(color: _themeController.currentThemeColor),
),
),
],
@@ -495,7 +517,7 @@ class _PermissionPageState extends State<PermissionPage> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
title: Row(
children: [
Icon(Icons.lightbulb, color: AppConstants.primaryColor),
Icon(Icons.lightbulb, color: _themeController.currentThemeColor),
const SizedBox(width: 8),
const Text('功能建议'),
],
@@ -516,7 +538,7 @@ class _PermissionPageState extends State<PermissionPage> {
TextSpan(
text: '情景诗词',
style: TextStyle(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontWeight: FontWeight.bold,
),
),
@@ -529,7 +551,7 @@ class _PermissionPageState extends State<PermissionPage> {
'记得五星好评 ⭐',
style: TextStyle(
fontSize: 14,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontWeight: FontWeight.w500,
),
),
@@ -540,7 +562,7 @@ class _PermissionPageState extends State<PermissionPage> {
onPressed: () => Navigator.pop(context),
child: Text(
'确定',
style: TextStyle(color: AppConstants.primaryColor),
style: TextStyle(color: _themeController.currentThemeColor),
),
),
],
@@ -555,7 +577,7 @@ class _PermissionPageState extends State<PermissionPage> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
title: Row(
children: [
Icon(Icons.info, color: AppConstants.primaryColor),
Icon(Icons.info, color: _themeController.currentThemeColor),
const SizedBox(width: 8),
const Text('基础权限说明'),
],
@@ -569,7 +591,7 @@ class _PermissionPageState extends State<PermissionPage> {
onPressed: () => Navigator.pop(context),
child: Text(
'确定',
style: TextStyle(color: AppConstants.primaryColor),
style: TextStyle(color: _themeController.currentThemeColor),
),
),
],
@@ -599,12 +621,12 @@ class _PermissionPageState extends State<PermissionPage> {
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
color: _themeController.currentThemeColor.withAlpha(10),
borderRadius: BorderRadius.circular(8),
),
child: Icon(
Icons.shield,
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
size: 20,
),
),
@@ -612,7 +634,7 @@ class _PermissionPageState extends State<PermissionPage> {
Text(
'沙盒运行说明',
style: TextStyle(
color: AppConstants.primaryColor,
color: _themeController.currentThemeColor,
fontSize: 16,
fontWeight: FontWeight.bold,
),
@@ -652,14 +674,14 @@ class _PermissionPageState extends State<PermissionPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 4,
height: 4,
margin: const EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: AppConstants.primaryColor,
borderRadius: BorderRadius.circular(2),
width: 4,
height: 4,
margin: const EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: _themeController.currentThemeColor,
borderRadius: BorderRadius.circular(2),
),
),
),
const SizedBox(width: 12),
Expanded(
child: Column(

View File

@@ -38,7 +38,7 @@ class _SpGuidePageState extends State<SpGuidePage>
final int _totalPages = 3;
final List<String> _pageTitles = ['欢迎使用', '双击中心区域查看协议', '了解软件功能'];
final List<String> _pageTitles = ['欢迎使用', '双击中心区域可左右滑动查看', '了解软件功能'];
@override
void initState() {
@@ -191,7 +191,7 @@ class _SpGuidePageState extends State<SpGuidePage>
_nextPage();
},
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
backgroundColor: _themeController.currentThemeColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
@@ -221,6 +221,7 @@ class _SpGuidePageState extends State<SpGuidePage>
Widget build(BuildContext context) {
return Obx(() {
final isDark = _themeController.isDarkMode;
final primaryColor = _themeController.currentThemeColor;
return WillPopScope(
onWillPop: () async {
if (widget.fromSettings) {
@@ -230,7 +231,7 @@ class _SpGuidePageState extends State<SpGuidePage>
},
child: Scaffold(
backgroundColor: isDark ? const Color(0xFF1A1A1A) : Colors.white,
appBar: _buildAppBar(isDark),
appBar: _buildAppBar(isDark, primaryColor),
body: Stack(
children: [
PageView(
@@ -243,13 +244,13 @@ class _SpGuidePageState extends State<SpGuidePage>
});
},
children: [
_buildWelcomePage(isDark),
_buildPrivacyPage(isDark),
_buildFeaturePage(isDark),
_buildWelcomePage(isDark, primaryColor),
_buildPrivacyPage(isDark, primaryColor),
_buildFeaturePage(isDark, primaryColor),
],
),
_buildPageIndicator(isDark),
_buildBottomNavigation(isDark),
_buildPageIndicator(isDark, primaryColor),
_buildBottomNavigation(isDark, primaryColor),
],
),
),
@@ -257,7 +258,7 @@ class _SpGuidePageState extends State<SpGuidePage>
});
}
Widget _buildPageIndicator(bool isDark) {
Widget _buildPageIndicator(bool isDark, Color primaryColor) {
double alignmentY;
switch (_currentPage) {
case 0:
@@ -318,19 +319,17 @@ class _SpGuidePageState extends State<SpGuidePage>
decoration: BoxDecoration(
shape: BoxShape.circle,
color: isActive
? AppConstants.primaryColor
? primaryColor
: isCompleted
? AppConstants.primaryColor.withValues(alpha: 0.5)
? primaryColor.withAlpha(50)
: (isDark ? Colors.grey[600] : Colors.grey[300]),
border: isActive
? Border.all(color: AppConstants.primaryColor, width: 3)
? Border.all(color: primaryColor, width: 3)
: null,
boxShadow: isActive
? [
BoxShadow(
color: AppConstants.primaryColor.withValues(
alpha: 0.3,
),
color: primaryColor.withAlpha(30),
blurRadius: 8,
spreadRadius: 2,
),
@@ -346,21 +345,18 @@ class _SpGuidePageState extends State<SpGuidePage>
);
}
PreferredSizeWidget _buildAppBar(bool isDark) {
PreferredSizeWidget _buildAppBar(bool isDark, Color primaryColor) {
return AppBar(
title: Text(
_pageTitles[_currentPage],
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: widget.fromSettings
? IconButton(
icon: Icon(Icons.arrow_back, color: AppConstants.primaryColor),
icon: Icon(Icons.arrow_back, color: primaryColor),
onPressed: () => Navigator.pop(context),
)
: null,
@@ -368,7 +364,7 @@ class _SpGuidePageState extends State<SpGuidePage>
);
}
Widget _buildWelcomePage(bool isDark) {
Widget _buildWelcomePage(bool isDark, Color primaryColor) {
return Container(
padding: const EdgeInsets.all(32),
child: Column(
@@ -379,10 +375,7 @@ class _SpGuidePageState extends State<SpGuidePage>
height: 120,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
AppConstants.primaryColor.withValues(alpha: 0.1),
AppConstants.primaryColor.withValues(alpha: 0.05),
],
colors: [primaryColor.withAlpha(10), primaryColor.withAlpha(5)],
),
borderRadius: BorderRadius.circular(30),
),
@@ -405,7 +398,7 @@ class _SpGuidePageState extends State<SpGuidePage>
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w600,
color: AppConstants.primaryColor,
color: primaryColor,
),
),
const SizedBox(height: 32),
@@ -455,17 +448,10 @@ class _SpGuidePageState extends State<SpGuidePage>
),
);
},
icon: Icon(
Icons.security,
size: 18,
color: AppConstants.primaryColor,
),
icon: Icon(Icons.security, size: 18, color: primaryColor),
label: Text(
'了解软件权限',
style: TextStyle(
color: AppConstants.primaryColor,
fontSize: 14,
),
style: TextStyle(color: primaryColor, fontSize: 14),
),
style: TextButton.styleFrom(
padding: const EdgeInsets.symmetric(
@@ -474,9 +460,7 @@ class _SpGuidePageState extends State<SpGuidePage>
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: BorderSide(
color: AppConstants.primaryColor.withValues(alpha: 0.3),
),
side: BorderSide(color: primaryColor.withAlpha(30)),
),
),
),
@@ -536,7 +520,7 @@ class _SpGuidePageState extends State<SpGuidePage>
? Icons.check_circle
: Icons.info_outline,
color: _showGuideOnStartup
? AppConstants.primaryColor
? _themeController.currentThemeColor
: (isDark ? Colors.grey[400] : Colors.grey[600]),
size: 24,
),
@@ -556,7 +540,7 @@ class _SpGuidePageState extends State<SpGuidePage>
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: _showGuideOnStartup
? AppConstants.primaryColor.withValues(alpha: 0.1)
? _themeController.currentThemeColor.withAlpha(10)
: (isDark ? const Color(0xFF2A2A2A) : Colors.grey[50]),
borderRadius: BorderRadius.circular(12),
),
@@ -567,7 +551,7 @@ class _SpGuidePageState extends State<SpGuidePage>
? Icons.notifications_active
: Icons.notifications_off,
color: _showGuideOnStartup
? AppConstants.primaryColor
? _themeController.currentThemeColor
: (isDark ? Colors.grey[400] : Colors.grey[500]),
size: 40,
),
@@ -578,7 +562,7 @@ class _SpGuidePageState extends State<SpGuidePage>
fontSize: 16,
fontWeight: FontWeight.w600,
color: _showGuideOnStartup
? AppConstants.primaryColor
? _themeController.currentThemeColor
: (isDark ? Colors.white : Colors.grey[700]),
),
),
@@ -600,7 +584,7 @@ class _SpGuidePageState extends State<SpGuidePage>
child: ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
backgroundColor: _themeController.currentThemeColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 12),
shape: RoundedRectangleBorder(
@@ -617,7 +601,7 @@ class _SpGuidePageState extends State<SpGuidePage>
);
}
Widget _buildPrivacyPage(bool isDark) {
Widget _buildPrivacyPage(bool isDark, Color primaryColor) {
_initTabController();
return Stack(
children: [
@@ -627,11 +611,11 @@ class _SpGuidePageState extends State<SpGuidePage>
color: isDark ? const Color(0xFF2A2A2A) : Colors.white,
child: TabBar(
controller: _tabController!,
labelColor: AppConstants.primaryColor,
labelColor: primaryColor,
unselectedLabelColor: isDark
? Colors.grey[400]
: Colors.grey[600],
indicatorColor: AppConstants.primaryColor,
indicatorColor: primaryColor,
indicatorWeight: 2,
tabs: const [
Tab(text: '《隐私政策》'),
@@ -713,20 +697,14 @@ class _SpGuidePageState extends State<SpGuidePage>
left: 0,
top: 0,
bottom: 0,
child: Container(
width: 3,
color: AppConstants.primaryColor,
),
child: Container(width: 3, color: primaryColor),
),
if (_isAgreementFocused)
Positioned(
right: 0,
top: 0,
bottom: 0,
child: Container(
width: 3,
color: AppConstants.primaryColor,
),
child: Container(width: 3, color: primaryColor),
),
],
),
@@ -779,7 +757,7 @@ class _SpGuidePageState extends State<SpGuidePage>
_rejectAgreement();
}
},
activeColor: AppConstants.primaryColor,
activeColor: primaryColor,
),
Expanded(
child: GestureDetector(
@@ -795,7 +773,7 @@ class _SpGuidePageState extends State<SpGuidePage>
style: TextStyle(
fontSize: 14,
color: _agreementAccepted
? AppConstants.primaryColor
? primaryColor
: (isDark
? Colors.grey[300]
: Colors.grey[700]),
@@ -814,7 +792,7 @@ class _SpGuidePageState extends State<SpGuidePage>
: _rejectAndExit,
style: ElevatedButton.styleFrom(
backgroundColor: _agreementAccepted
? AppConstants.primaryColor
? primaryColor
: (isDark ? Colors.grey[700] : Colors.grey[600]),
foregroundColor: Colors.white,
disabledBackgroundColor: isDark
@@ -843,7 +821,7 @@ class _SpGuidePageState extends State<SpGuidePage>
);
}
Widget _buildFeaturePage(bool isDark) {
Widget _buildFeaturePage(bool isDark, Color primaryColor) {
return Padding(
padding: const EdgeInsets.fromLTRB(24, 16, 24, 100),
child: Column(
@@ -920,11 +898,7 @@ class _SpGuidePageState extends State<SpGuidePage>
),
child: Row(
children: [
Icon(
Icons.volunteer_activism,
color: AppConstants.primaryColor,
size: 18,
),
Icon(Icons.volunteer_activism, color: primaryColor, size: 18),
const SizedBox(width: 8),
Expanded(
child: GestureDetector(
@@ -963,7 +937,7 @@ class _SpGuidePageState extends State<SpGuidePage>
Switch(
value: _userPlanJoined,
onChanged: _toggleUserPlan,
activeThumbColor: AppConstants.primaryColor,
activeThumbColor: primaryColor,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
],
@@ -1044,7 +1018,7 @@ class _SpGuidePageState extends State<SpGuidePage>
child: ElevatedButton(
onPressed: _finishGuide,
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
backgroundColor: primaryColor,
foregroundColor: Colors.white,
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
@@ -1127,7 +1101,7 @@ class _SpGuidePageState extends State<SpGuidePage>
);
}
Widget _buildBottomNavigation(bool isDark) {
Widget _buildBottomNavigation(bool isDark, Color primaryColor) {
return Positioned(
bottom: 0,
left: 0,
@@ -1143,6 +1117,7 @@ class _SpGuidePageState extends State<SpGuidePage>
label: '上一页',
onPressed: _previousPage,
isDark: isDark,
primaryColor: primaryColor,
)
: const SizedBox(width: 100),
_currentPage < _totalPages - 1
@@ -1153,12 +1128,14 @@ class _SpGuidePageState extends State<SpGuidePage>
? null
: _nextPage,
isDark: isDark,
primaryColor: primaryColor,
)
: _buildNavButton(
icon: Icons.check,
label: '完成',
onPressed: _agreementAccepted ? _finishGuide : null,
isDark: isDark,
primaryColor: primaryColor,
),
],
),
@@ -1171,17 +1148,18 @@ class _SpGuidePageState extends State<SpGuidePage>
required String label,
VoidCallback? onPressed,
required bool isDark,
required Color primaryColor,
}) {
return Container(
decoration: BoxDecoration(
color: onPressed != null
? AppConstants.primaryColor
? primaryColor
: (isDark ? Colors.grey[700] : Colors.grey[300]),
borderRadius: BorderRadius.circular(12),
boxShadow: onPressed != null
? [
BoxShadow(
color: AppConstants.primaryColor.withValues(alpha: 0.3),
color: primaryColor.withAlpha(30),
blurRadius: 8,
offset: const Offset(0, 2),
),