62 lines
2.1 KiB
Dart
62 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../../l10n/app_localizations.dart';
|
|
import '../../../../shared/theme/design_tokens.dart';
|
|
import '../models/legal_document_type.dart';
|
|
import '../utils/legal_document_assets.dart';
|
|
import '../widgets/settings_section_widgets.dart';
|
|
import 'legal_document_screen.dart';
|
|
|
|
class LegalCenterScreen extends StatelessWidget {
|
|
const LegalCenterScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context)!;
|
|
final colors = Theme.of(context).colorScheme;
|
|
final locale = Localizations.localeOf(context);
|
|
final documents = [
|
|
LegalDocumentType.aboutUs,
|
|
LegalDocumentType.privacyPolicy,
|
|
LegalDocumentType.termsOfService,
|
|
];
|
|
|
|
return Scaffold(
|
|
backgroundColor: colors.surfaceContainerLow,
|
|
appBar: AppBar(
|
|
title: Text(l10n.settingsLegalCenterTitle),
|
|
centerTitle: true,
|
|
backgroundColor: colors.surfaceContainerLow,
|
|
surfaceTintColor: colors.surfaceContainerLow,
|
|
),
|
|
body: ListView(
|
|
padding: const EdgeInsets.all(AppSpacing.lg),
|
|
children: [
|
|
SectionLabel(text: l10n.settingsSectionAbout),
|
|
SettingsGroupCard(
|
|
children: [
|
|
for (int i = 0; i < documents.length; i++)
|
|
SettingsMenuTile(
|
|
icon: legalDocumentIcon(documents[i]),
|
|
title: legalDocumentTitle(l10n, documents[i]),
|
|
subtitle: legalDocumentSubtitle(l10n, documents[i]),
|
|
tint: colors.primary,
|
|
background: colors.surfaceContainerHighest,
|
|
showDivider: i != documents.length - 1,
|
|
onTap: () => Navigator.of(context).push(
|
|
MaterialPageRoute<void>(
|
|
builder: (_) => LegalDocumentScreen(
|
|
title: legalDocumentTitle(l10n, documents[i]),
|
|
assetPath: legalDocumentAssetPath(locale, documents[i]),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|