完善细类

This commit is contained in:
Developer
2026-03-31 07:56:35 +08:00
parent 66f72abab4
commit 9a58f6ca19
12 changed files with 683 additions and 257 deletions

View File

@@ -50,21 +50,20 @@ class _PermissionPageState extends State<PermissionPage> {
elevation: 0,
centerTitle: true,
leading: IconButton(
icon: const Icon(Icons.arrow_back),
icon: Icon(Icons.arrow_back, color: AppConstants.primaryColor),
onPressed: () => Navigator.pop(context),
),
actions: [
IconButton(
icon: Icon(Icons.info_outline, color: AppConstants.primaryColor),
onPressed: _showPermissionInfoDialog,
),
],
),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
_buildPermissionGroup('基础权限', [
_buildPermissionItem(
'震动反馈',
'操作时的震动反馈,提升交互体验',
Icons.vibration,
_vibrationEnabled,
null,
),
_buildPermissionGroup('权限列表', [
_buildPermissionItem(
'网络访问',
'访问网络获取诗词内容和数据',
@@ -72,6 +71,14 @@ class _PermissionPageState extends State<PermissionPage> {
_networkEnabled,
null,
),
_buildPermissionItem(
'震动反馈',
'操作时的震动反馈,提升交互体验',
Icons.vibration,
_vibrationEnabled,
null,
),
_buildPermissionItem(
'剪切板',
'复制诗词内容到剪切板',
@@ -79,15 +86,35 @@ class _PermissionPageState extends State<PermissionPage> {
_clipboardEnabled,
null,
),
_buildPermissionItem(
'播放声音',
'播放内置提示音',
Icons.audio_file,
_clipboardEnabled,
null,
),
_buildPermissionItem(
'分享能力',
'调用系统分享接口',
Icons.share,
_clipboardEnabled,
null,
),
]),
const SizedBox(height: 16),
_buildPermissionGroup('权限说明', [
_buildInfoItem('震动反馈', '用于点赞、收藏等操作的触觉反馈,提升用户体验。'),
_buildInfoItem('网络访问', '用于获取诗词内容、排行榜数据、用户信息等。'),
_buildInfoItem('剪切板', '用于复制诗词内容,方便用户分享和记录。'),
_buildInfoItem('播放声音', '用于主页点击提示音,提升用户体验。'),
_buildInfoItem('分享能力', '用于分享诗词内容到社交媒体平台。'),
]),
const SizedBox(height: 16),
_buildSandboxInfoCard(),
const SizedBox(height: 16),
_buildProjectSupplement(),
const SizedBox(height: 24),
_buildBottomTip(),
],
),
);
@@ -229,7 +256,7 @@ class _PermissionPageState extends State<PermissionPage> {
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 4),
// const SizedBox(height: 4),
Text(
description,
style: TextStyle(
@@ -292,18 +319,18 @@ class _PermissionPageState extends State<PermissionPage> {
Icons.lightbulb,
() => _showSuggestionDialog(),
),
_buildSupplementItem(
'Bug报告',
'报告遇到的问题',
Icons.bug_report,
() => _showBugReportDialog(),
),
_buildSupplementItem(
'参与开发',
'成为贡献者',
Icons.code,
() => _showContributionDialog(),
),
// _buildSupplementItem(
// 'Bug报告',
// '报告遇到的问题',
// Icons.bug_report,
// () => _showBugReportDialog(),
// ),
// _buildSupplementItem(
// '参与开发',
// '成为贡献者',
// Icons.code,
// () => _showContributionDialog(),
// ),
],
),
);
@@ -373,19 +400,33 @@ class _PermissionPageState extends State<PermissionPage> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'感谢您的反馈!请详细描述您遇到的问题或建议。',
style: TextStyle(fontSize: 14, height: 1.5),
),
const SizedBox(height: 16),
TextField(
maxLines: 5,
decoration: InputDecoration(
hintText: '请输入您的反馈内容...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
RichText(
text: TextSpan(
style: const TextStyle(
fontSize: 14,
height: 1.5,
color: Colors.black87,
),
contentPadding: const EdgeInsets.all(12),
children: [
const TextSpan(text: '软件内暂时无法反馈,请前往应用商店搜索 '),
TextSpan(
text: '情景诗词',
style: TextStyle(
color: AppConstants.primaryColor,
fontWeight: FontWeight.bold,
),
),
const TextSpan(text: ' 在详细页面 点击提交心愿单'),
],
),
),
const SizedBox(height: 12),
Text(
'记得五星好评 ⭐',
style: TextStyle(
fontSize: 14,
color: AppConstants.primaryColor,
fontWeight: FontWeight.w500,
),
),
],
@@ -393,23 +434,10 @@ class _PermissionPageState extends State<PermissionPage> {
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('取消'),
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
ScaffoldMessenger.of(
context,
).showSnackBar(const SnackBar(content: Text('反馈已提交,感谢您的支持!')));
},
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Text(
'确定',
style: TextStyle(color: AppConstants.primaryColor),
),
child: const Text('提交'),
),
],
),
@@ -432,19 +460,33 @@ class _PermissionPageState extends State<PermissionPage> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'我们非常期待您的创意!请描述您希望添加的功能。',
style: TextStyle(fontSize: 14, height: 1.5),
),
const SizedBox(height: 16),
TextField(
maxLines: 5,
decoration: InputDecoration(
hintText: '请输入您的功能建议...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
RichText(
text: TextSpan(
style: const TextStyle(
fontSize: 14,
height: 1.5,
color: Colors.black87,
),
contentPadding: const EdgeInsets.all(12),
children: [
const TextSpan(text: '软件内暂时无法反馈,请前往应用商店搜索 '),
TextSpan(
text: '情景诗词',
style: TextStyle(
color: AppConstants.primaryColor,
fontWeight: FontWeight.bold,
),
),
const TextSpan(text: ' 在详细页面 点击提交心愿单'),
],
),
),
const SizedBox(height: 12),
Text(
'记得五星好评 ⭐',
style: TextStyle(
fontSize: 14,
color: AppConstants.primaryColor,
fontWeight: FontWeight.w500,
),
),
],
@@ -452,148 +494,166 @@ class _PermissionPageState extends State<PermissionPage> {
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('取消'),
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
ScaffoldMessenger.of(
context,
).showSnackBar(const SnackBar(content: Text('建议已提交,我们会认真考虑!')));
},
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Text(
'确定',
style: TextStyle(color: AppConstants.primaryColor),
),
child: const Text('提交'),
),
],
),
);
}
void _showBugReportDialog() {
void _showPermissionInfoDialog() {
showDialog(
context: context,
builder: (context) => AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
title: Row(
children: [
Icon(Icons.bug_report, color: AppConstants.primaryColor),
Icon(Icons.info, color: AppConstants.primaryColor),
const SizedBox(width: 8),
const Text('Bug报告'),
const Text('基础权限说明'),
],
),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'请详细描述遇到的问题,我们会尽快修复。',
style: TextStyle(fontSize: 14, height: 1.5),
),
const SizedBox(height: 16),
TextField(
maxLines: 5,
decoration: InputDecoration(
hintText: '请描述您遇到的问题...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
contentPadding: const EdgeInsets.all(12),
),
),
],
content: const Text(
'系统赋予的基础软件权限无法拒绝;自带权限默认开启,用户无需动态授权,系统层关闭后,将无法正常使用应用。',
style: TextStyle(fontSize: 14, height: 1.5),
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('取消'),
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
ScaffoldMessenger.of(
context,
).showSnackBar(const SnackBar(content: Text('Bug报告已提交感谢您的反馈')));
},
style: ElevatedButton.styleFrom(
backgroundColor: AppConstants.primaryColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Text(
'确定',
style: TextStyle(color: AppConstants.primaryColor),
),
child: const Text('提交'),
),
],
),
);
}
void _showContributionDialog() {
showDialog(
context: context,
builder: (context) => AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
title: Row(
children: [
Icon(Icons.code, color: AppConstants.primaryColor),
const SizedBox(width: 8),
const Text('参与开发'),
],
),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'欢迎参与项目开发!请选择您希望参与的方式。',
style: TextStyle(fontSize: 14, height: 1.5),
),
const SizedBox(height: 16),
_buildContributionOption('代码贡献', '提交代码改进'),
_buildContributionOption('文档完善', '完善项目文档'),
_buildContributionOption('测试反馈', '提供测试反馈'),
_buildContributionOption('设计建议', 'UI/UX设计建议'),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('关闭'),
),
],
),
);
}
Widget _buildContributionOption(String title, String description) {
Widget _buildSandboxInfoCard() {
return Container(
margin: const EdgeInsets.only(bottom: 12),
padding: const EdgeInsets.all(12),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.grey[50],
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey.withValues(alpha: 0.2)),
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
Row(
children: [
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: AppConstants.primaryColor.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8),
),
child: Icon(
Icons.shield,
color: AppConstants.primaryColor,
size: 20,
),
),
const SizedBox(width: 12),
Text(
'沙盒运行说明',
style: TextStyle(
color: AppConstants.primaryColor,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
],
),
const SizedBox(height: 4),
const SizedBox(height: 12),
const Divider(height: 1),
const SizedBox(height: 12),
Text(
description,
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
'本软件严格遵循移动平台沙盒机制运行,确保您的数据安全:',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.grey[800],
),
),
const SizedBox(height: 12),
_buildSandboxItem('📱 沙盒隔离', '软件在独立沙盒环境中运行,无法访问系统其他应用数据'),
const SizedBox(height: 8),
_buildSandboxItem('📄 无文件创建', '不会在设备上创建额外文件,所有数据通过网络获取'),
const SizedBox(height: 8),
_buildSandboxItem('🔒 权限透明', '仅使用必要权限,此类权限均为基础权限'),
const SizedBox(height: 8),
_buildSandboxItem('💾 本地存储', '仅使用 SharedPreferences 存储少量用户偏好设置'),
],
),
);
}
Widget _buildSandboxItem(String title, String description) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 4,
height: 4,
margin: const EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: AppConstants.primaryColor,
borderRadius: BorderRadius.circular(2),
),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.grey[800],
),
),
const SizedBox(height: 4),
Text(
description,
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
height: 1.5,
),
),
],
),
),
],
);
}
Widget _buildBottomTip() {
return Center(
child: Padding(
padding: const EdgeInsets.only(bottom: 32),
child: Text(
'到底了',
style: TextStyle(
fontSize: 14,
color: Colors.grey[400],
fontWeight: FontWeight.w500,
),
),
),
);
}
}