Initial commit
This commit is contained in:
114
lib/pages/policy_page.dart
Normal file
114
lib/pages/policy_page.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
|
||||
class PolicyPage extends StatelessWidget {
|
||||
final String type;
|
||||
const PolicyPage({super.key, required this.type});
|
||||
|
||||
bool get isAgreement => type == 'agreement';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.background,
|
||||
appBar: AppBar(
|
||||
title: Text(isAgreement ? l10n.userAgreement : l10n.privacyPolicy),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.surface,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
isAgreement ? l10n.agreementTitle : l10n.privacyTitle,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
l10n.lastUpdated,
|
||||
style: const TextStyle(fontSize: 12, color: AppColors.textTertiary),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (isAgreement) ..._buildAgreementContent(context, l10n) else ..._buildPrivacyContent(context, l10n),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _buildAgreementContent(BuildContext context, AppLocalizations l10n) {
|
||||
return [
|
||||
_section(l10n.agreementSection1),
|
||||
_paragraph(l10n.agreementPara1),
|
||||
_section(l10n.agreementSection2),
|
||||
_paragraph(l10n.agreementPara2),
|
||||
_section(l10n.agreementSection3),
|
||||
_paragraph(l10n.agreementPara3),
|
||||
_section(l10n.agreementSection4),
|
||||
_paragraph(l10n.agreementPara4),
|
||||
_section(l10n.agreementSection5),
|
||||
_paragraph(l10n.agreementPara5),
|
||||
_section(l10n.agreementSection6),
|
||||
_paragraph(l10n.agreementPara6),
|
||||
_section(l10n.agreementSection7),
|
||||
_paragraph(l10n.agreementPara7),
|
||||
];
|
||||
}
|
||||
|
||||
List<Widget> _buildPrivacyContent(BuildContext context, AppLocalizations l10n) {
|
||||
return [
|
||||
_section(l10n.privacySection1),
|
||||
_paragraph(l10n.privacyPara1),
|
||||
_section(l10n.privacySection2),
|
||||
_paragraph(l10n.privacyPara2),
|
||||
_section(l10n.privacySection3),
|
||||
_paragraph(l10n.privacyPara3),
|
||||
_section(l10n.privacySection4),
|
||||
_paragraph(l10n.privacyPara4),
|
||||
_section(l10n.privacySection5),
|
||||
_paragraph(l10n.privacyPara5),
|
||||
_section(l10n.privacySection6),
|
||||
_paragraph(l10n.privacyPara6),
|
||||
_section(l10n.privacySection7),
|
||||
_paragraph(l10n.privacyPara7),
|
||||
];
|
||||
}
|
||||
|
||||
Widget _section(String title) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 20, bottom: 8),
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _paragraph(String text) {
|
||||
return Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColors.textSecondary,
|
||||
height: 1.7,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user