import 'package:flutter/material.dart'; import '../theme/app_theme.dart'; class AboutScreen extends StatelessWidget { const AboutScreen({super.key}); @override Widget build(BuildContext context) { final theme = Theme.of(context); return Scaffold( appBar: AppBar( title: const Text('关于'), ), body: SingleChildScrollView( padding: const EdgeInsets.all(24), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ // 应用图标和名称 Container( width: 80, height: 80, decoration: BoxDecoration( color: AppTheme.primaryColor, borderRadius: BorderRadius.circular(20), ), child: const Icon( Icons.timer, color: Colors.white, size: 48, ), ), const SizedBox(height: 16), Text( 'AutoTime Tracker', style: theme.textTheme.headlineMedium?.copyWith( fontWeight: FontWeight.bold, ), ), const SizedBox(height: 8), Text( '版本 1.0.0', style: theme.textTheme.bodyMedium?.copyWith( color: theme.colorScheme.onSurface.withOpacity(0.6), ), ), const SizedBox(height: 32), // 应用描述 Card( child: Padding( padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( '关于应用', style: theme.textTheme.titleMedium?.copyWith( fontWeight: FontWeight.w600, ), ), const SizedBox(height: 12), Text( 'AutoTime Tracker 是一款自动时间追踪与效率分析工具。' '它可以帮助您自动追踪应用使用情况,分析时间分配,' '并提供效率评分和个性化建议。', style: theme.textTheme.bodyMedium, ), ], ), ), ), const SizedBox(height: 16), // 功能特点 Card( child: Padding( padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( '核心功能', style: theme.textTheme.titleMedium?.copyWith( fontWeight: FontWeight.w600, ), ), const SizedBox(height: 12), _buildFeatureItem(theme, Icons.auto_awesome, '自动追踪', '无需手动操作,自动记录应用使用时间'), _buildFeatureItem(theme, Icons.category, '智能分类', '自动将应用分类为工作、学习、娱乐等'), _buildFeatureItem(theme, Icons.insights, '数据分析', '提供详细的统计分析和效率评分'), _buildFeatureItem(theme, Icons.flag, '目标设定', '设置时间目标,追踪完成情况'), _buildFeatureItem(theme, Icons.file_download, '数据导出', '导出 CSV 和统计报告'), ], ), ), ), const SizedBox(height: 16), // 链接 Card( child: Column( children: [ _buildLinkItem( context, theme, Icons.description, '隐私政策', '查看我们的隐私政策', () { // TODO: 打开隐私政策页面 _showComingSoon(context); }, ), const Divider(height: 1), _buildLinkItem( context, theme, Icons.feedback, '反馈建议', '帮助我们改进应用', () { _launchEmail(context); }, ), const Divider(height: 1), _buildLinkItem( context, theme, Icons.star, '评价应用', '在应用商店给我们评分', () { // TODO: 打开应用商店 _showComingSoon(context); }, ), const Divider(height: 1), _buildLinkItem( context, theme, Icons.code, '开源许可', 'MIT License', () { _showLicense(context, theme); }, ), ], ), ), const SizedBox(height: 24), // 版权信息 Text( '© 2024 AutoTime Tracker', style: theme.textTheme.bodySmall?.copyWith( color: theme.colorScheme.onSurface.withOpacity(0.5), ), ), const SizedBox(height: 8), Text( 'Made with ❤️ using Flutter', style: theme.textTheme.bodySmall?.copyWith( color: theme.colorScheme.onSurface.withOpacity(0.5), ), ), ], ), ), ); } Widget _buildFeatureItem(ThemeData theme, IconData icon, String title, String description) { return Padding( padding: const EdgeInsets.only(bottom: 12), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Icon(icon, color: AppTheme.primaryColor, size: 24), const SizedBox(width: 12), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title, style: theme.textTheme.bodyLarge?.copyWith( fontWeight: FontWeight.w600, ), ), const SizedBox(height: 4), Text( description, style: theme.textTheme.bodySmall?.copyWith( color: theme.colorScheme.onSurface.withOpacity(0.6), ), ), ], ), ), ], ), ); } Widget _buildLinkItem( BuildContext context, ThemeData theme, IconData icon, String title, String subtitle, VoidCallback onTap, ) { return ListTile( leading: Icon(icon, color: AppTheme.primaryColor), title: Text( title, style: theme.textTheme.bodyLarge?.copyWith( fontWeight: FontWeight.w500, ), ), subtitle: Text( subtitle, style: theme.textTheme.bodySmall?.copyWith( color: theme.colorScheme.onSurface.withOpacity(0.6), ), ), trailing: const Icon(Icons.chevron_right), onTap: onTap, ); } void _launchEmail(BuildContext context) { // 显示反馈邮箱 showDialog( context: context, builder: (context) => AlertDialog( title: const Text('反馈建议'), content: const Text( '欢迎通过以下方式联系我们:\n\n' '邮箱:support@autotime-tracker.com\n\n' '我们非常重视您的反馈和建议!', ), actions: [ TextButton( onPressed: () => Navigator.of(context).pop(), child: const Text('确定'), ), ], ), ); } void _showComingSoon(BuildContext context) { showDialog( context: context, builder: (context) => AlertDialog( title: const Text('即将推出'), content: const Text('此功能正在开发中,敬请期待!'), actions: [ TextButton( onPressed: () => Navigator.of(context).pop(), child: const Text('确定'), ), ], ), ); } void _showLicense(BuildContext context, ThemeData theme) { showLicensePage( context: context, applicationName: 'AutoTime Tracker', applicationVersion: '1.0.0', applicationIcon: Container( width: 64, height: 64, decoration: BoxDecoration( color: AppTheme.primaryColor, borderRadius: BorderRadius.circular(16), ), child: const Icon( Icons.timer, color: Colors.white, size: 32, ), ), ); } }