248 lines
9.0 KiB
Dart
248 lines
9.0 KiB
Dart
import 'package:flutter/material.dart';
|
||
import 'package:airhub_app/theme/design_tokens.dart';
|
||
|
||
class SettingsContentPage extends StatelessWidget {
|
||
final String title;
|
||
final String date;
|
||
final List<Widget> children;
|
||
|
||
const SettingsContentPage({
|
||
super.key,
|
||
required this.title,
|
||
required this.date,
|
||
required this.children,
|
||
});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Scaffold(
|
||
backgroundColor: AppColors.background,
|
||
body: Stack(
|
||
children: [
|
||
Container(
|
||
decoration: const BoxDecoration(color: Color(0xFFFEFEFE)),
|
||
), // Simplified background
|
||
Column(
|
||
children: [
|
||
_buildHeader(context),
|
||
Expanded(
|
||
child: SingleChildScrollView(
|
||
padding: EdgeInsets.only(
|
||
top: 20,
|
||
left: 24,
|
||
right: 24,
|
||
bottom: 40 + MediaQuery.of(context).padding.bottom,
|
||
),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
...children,
|
||
const SizedBox(height: 40),
|
||
Center(
|
||
child: Text(
|
||
'更新日期:$date',
|
||
style: const TextStyle(
|
||
color: AppColors.textSecondary,
|
||
fontSize: 13,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildHeader(BuildContext context) {
|
||
return Container(
|
||
padding: EdgeInsets.only(
|
||
top: MediaQuery.of(context).padding.top + 20,
|
||
left: AppSpacing.lg,
|
||
right: AppSpacing.lg,
|
||
bottom: AppSpacing.md,
|
||
),
|
||
child: Row(
|
||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
children: [
|
||
GestureDetector(
|
||
onTap: () => Navigator.pop(context),
|
||
child: Container(
|
||
width: 44,
|
||
height: 44,
|
||
decoration: BoxDecoration(
|
||
color: AppColors.iconBtnBg,
|
||
borderRadius: BorderRadius.circular(AppRadius.button),
|
||
border: Border.all(color: AppColors.iconBtnBorder),
|
||
),
|
||
child: const Icon(
|
||
Icons.arrow_back,
|
||
color: AppColors.textPrimary,
|
||
size: 20,
|
||
),
|
||
),
|
||
),
|
||
Text(title, style: AppTextStyles.title),
|
||
const SizedBox(width: 44), // Balance
|
||
],
|
||
),
|
||
);
|
||
}
|
||
}
|
||
|
||
// Helper methods to generate text styles
|
||
Widget buildSectionTitle(String text) {
|
||
return Padding(
|
||
padding: const EdgeInsets.only(top: 32, bottom: 12),
|
||
child: Text(
|
||
text,
|
||
style: const TextStyle(
|
||
fontSize: 17,
|
||
fontWeight: FontWeight.w700,
|
||
color: AppColors.textPrimary,
|
||
),
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget buildParagraph(String text) {
|
||
return Padding(
|
||
padding: const EdgeInsets.only(bottom: 16),
|
||
child: Text(
|
||
text,
|
||
textAlign: TextAlign.justify,
|
||
style: const TextStyle(
|
||
fontSize: 15,
|
||
height: 1.6,
|
||
color: Color(0xFF374151),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget buildBulletList(List<String> items) {
|
||
return Padding(
|
||
padding: const EdgeInsets.only(bottom: 16, left: 20),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: items
|
||
.map(
|
||
(item) => Padding(
|
||
padding: const EdgeInsets.only(bottom: 8),
|
||
child: Row(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
const Text('• ', style: TextStyle(fontSize: 15, height: 1.6)),
|
||
Expanded(
|
||
child: Text(
|
||
item,
|
||
style: const TextStyle(
|
||
fontSize: 15,
|
||
height: 1.6,
|
||
color: Color(0xFF374151),
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
)
|
||
.toList(),
|
||
),
|
||
);
|
||
}
|
||
|
||
// Pre-defined pages content factories
|
||
class AgreementPage extends StatelessWidget {
|
||
const AgreementPage({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return SettingsContentPage(
|
||
title: '用户协议',
|
||
date: '2025年1月15日',
|
||
children: [
|
||
buildParagraph('欢迎您使用 Airhub 产品及服务!'),
|
||
buildParagraph(
|
||
'特别提示: 在您开始使用 Airhub 产品(以下简称"本产品")及相关服务之前,请您务必仔细阅读本《用户协议》(以下简称"本协议")。特别是涉及免除或者限制责任的条款、法律适用和争议解决条款等,请您重点阅读。',
|
||
),
|
||
buildSectionTitle('1. 服务说明'),
|
||
buildParagraph(
|
||
'1.1 Airhub Team(以下简称"我们")向用户提供包括但不限于设备连接控制、AI 语音交互、角色记忆存储、云端同步等服务(以下简称"本服务")。',
|
||
),
|
||
buildParagraph('1.2 本服务的具体内容由我们根据实际情况提供,我们有权随时变更、中断或终止部分或全部服务。'),
|
||
buildParagraph('1.3 用户理解并同意,本服务仅供用户个人非商业性质的使用。用户不得利用本服务进行销售或其他商业用途。'),
|
||
buildSectionTitle('2. 账号注册与使用'),
|
||
buildParagraph('2.1 用户在使用本服务时需要注册一个 Airhub 账号。用户应保证注册信息的真实性、准确性和完整性。'),
|
||
buildParagraph('2.2 用户有责任妥善保管注册账号信息及密码安全。因用户保管不善可能导致账号被盗及其后果,由用户自行承担。'),
|
||
buildParagraph(
|
||
'2.3 如发现任何未经授权使用您账号登录、使用本服务的情况,您应立即通知我们。您理解我们对您的任何请求采取行动需要合理时间,我们对在采取行动前已经产生的后果不承担责任。',
|
||
),
|
||
buildSectionTitle('3. 用户行为规范'),
|
||
buildParagraph('用户在使用本服务过程中,应当遵守法律法规,不得从事下列行为:'),
|
||
buildBulletList([
|
||
'发布、传送、传播、储存危害国家安全、破坏社会稳定、违反公序良俗的内容;',
|
||
'发布、传送、传播、储存侮辱、诽谤、淫秽、暴力、赌博等违法违规内容;',
|
||
'利用 AI 功能生成虚假信息、诈骗信息或用于非法用途;',
|
||
'对 AI 角色进行性骚扰、辱骂或诱导生成不当内容;',
|
||
'进行任何危害计算机网络安全的行为,包括但不限于攻击、侵入他人系统。',
|
||
]),
|
||
buildSectionTitle('4. 个人信息保护'),
|
||
buildParagraph(
|
||
'4.1 保护用户个人信息是我们的基本原则。我们将按照本协议及《隐私政策》的规定收集、使用、存储和分享您的个人信息。',
|
||
),
|
||
// ... simplified for brevity, following the pattern
|
||
],
|
||
);
|
||
}
|
||
}
|
||
|
||
class PrivacyPage extends StatelessWidget {
|
||
const PrivacyPage({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return SettingsContentPage(
|
||
title: '隐私政策',
|
||
date: '2025年1月15日',
|
||
children: [
|
||
buildParagraph('Airhub 非常重视用户的隐私保护。本隐私政策旨在向您说明我们如何收集、使用、存储和分享您的个人信息。'),
|
||
buildSectionTitle('1. 我们收集的信息'),
|
||
buildParagraph('1.1 为了向您提供服务,我们可能会收集您的手机号码、设备信息(如设备型号、操作系统版本)、IP地址等。'),
|
||
// ... Placeholder content similar to structure
|
||
buildParagraph('1.2 当您使用语音交互功能时,我们会处理您的语音数据以提供识别和回复服务。'),
|
||
],
|
||
);
|
||
}
|
||
}
|
||
|
||
class CollectionListPage extends StatelessWidget {
|
||
const CollectionListPage({super.key});
|
||
@override
|
||
Widget build(BuildContext context) => SettingsContentPage(
|
||
title: '个人信息收集清单',
|
||
date: '2025年1月15日',
|
||
children: [
|
||
buildParagraph('以下是我们收集的个人信息清单:'),
|
||
buildBulletList(['手机号码:用于账号注册和登录', '设备信息:用于适配和安全风控']),
|
||
],
|
||
);
|
||
}
|
||
|
||
class SharingListPage extends StatelessWidget {
|
||
const SharingListPage({super.key});
|
||
@override
|
||
Widget build(BuildContext context) => SettingsContentPage(
|
||
title: '第三方信息共享清单',
|
||
date: '2025年1月15日',
|
||
children: [
|
||
buildParagraph('我们可能会与以下第三方共享必要信息:'),
|
||
buildBulletList(['SDK服务商:提供推送、地图等基础服务', '云服务商:提供数据存储和计算服务']),
|
||
],
|
||
);
|
||
}
|