🗑️ Clean up about page

This commit is contained in:
2025-12-21 16:01:12 +08:00
parent 59c34ada40
commit 30b2c0a0b4
4 changed files with 280 additions and 286 deletions

View File

@@ -720,7 +720,7 @@
"aboutScreenDeveloperSectionTitle": "Developer",
"aboutScreenContactUsTitle": "Contact Us",
"aboutScreenLicenseTitle": "License",
"aboutScreenLicenseContent": "GNU Affero General Public License v3.0",
"aboutScreenLicenseContent": "AGPLv3",
"aboutScreenCopyright": "All rights reserved © Solsynth {}",
"aboutScreenMadeWith": "Made with ❤︎️ by Solar Network Team",
"aboutScreenFailedToLoadPackageInfo": "Failed to load package info: {error}",

View File

@@ -705,7 +705,7 @@
"aboutScreenDeveloperSectionTitle": "开发者",
"aboutScreenContactUsTitle": "联系我们",
"aboutScreenLicenseTitle": "许可",
"aboutScreenLicenseContent": "无法翻译",
"aboutScreenLicenseContent": "AGPLv3",
"aboutScreenCopyright": "版权所有 © Solsynth {}",
"aboutScreenMadeWith": "由 Solar Network 团队用 ❤︎️ 制作",
"aboutScreenFailedToLoadPackageInfo": "无法加载包信息:{error}",

View File

@@ -12,7 +12,6 @@ import 'package:island/widgets/app_scaffold.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:island/services/update_service.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:url_launcher/url_launcher_string.dart';
@@ -97,8 +96,7 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
return AppScaffold(
isNoBackground: false,
appBar: AppBar(title: Text('about'.tr()), elevation: 0),
body:
_isLoading
body: _isLoading
? const Center(child: CircularProgressIndicator())
: _errorMessage != null
? Center(child: Text(_errorMessage!))
@@ -113,8 +111,9 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
// App Icon and Name
CircleAvatar(
radius: 50,
backgroundColor: theme.colorScheme.primary
.withOpacity(0.1),
backgroundColor: theme.colorScheme.primary.withOpacity(
0.1,
),
child: Image.asset(
'assets/icons/icon.png',
width: 56,
@@ -177,8 +176,7 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
FutureBuilder<String>(
future: udid.getDeviceName(),
builder: (context, snapshot) {
final value =
snapshot.hasData
final value = snapshot.hasData
? snapshot.data!
: 'unknown'.tr();
return _buildInfoItem(
@@ -206,24 +204,11 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
context,
title: 'aboutScreenLinksSectionTitle'.tr(),
children: [
_buildListTile(
context,
icon: Symbols.system_update,
title: 'Check for updates',
onTap: () async {
final svc = UpdateService();
showLoadingModal(context);
svc.checkForUpdates(context);
if (!context.mounted) return;
hideLoadingModal(context);
},
),
_buildListTile(
context,
icon: Symbols.privacy_tip,
title: 'aboutScreenPrivacyPolicyTitle'.tr(),
onTap:
() => _launchURL(
onTap: () => _launchURL(
'https://solsynth.dev/terms/privacy-policy',
),
),
@@ -231,8 +216,7 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
context,
icon: Symbols.description,
title: 'aboutScreenTermsOfServiceTitle'.tr(),
onTap:
() => _launchURL(
onTap: () => _launchURL(
'https://solsynth.dev/terms/user-agreement',
),
),
@@ -264,18 +248,14 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
icon: Symbols.email,
title: 'aboutScreenContactUsTitle'.tr(),
subtitle: 'lily@solsynth.dev',
onTap:
() => _launchURL('mailto:lily@solsynth.dev'),
onTap: () => _launchURL('mailto:lily@solsynth.dev'),
),
_buildListTile(
context,
icon: Symbols.copyright,
title: 'aboutScreenLicenseTitle'.tr(),
subtitle: 'aboutScreenLicenseContent'.tr(
args: [DateTime.now().year.toString()],
),
onTap:
() => _launchURL(
subtitle: 'aboutScreenLicenseContent'.tr(),
onTap: () => _launchURL(
'https://github.com/Solsynth/Solian/blob/v3/LICENSE.txt',
),
),

View File

@@ -352,21 +352,14 @@ class AccountScreen extends HookConsumerWidget {
},
),
),
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.notifications),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Row(
children: [
Expanded(child: Text('notifications').tr()),
Badge.count(
count: notificationUnreadCount.value ?? 0,
isLabelVisible: (notificationUnreadCount.value ?? 0) > 0,
),
],
),
onTap: () {
Builder(
builder: (context) {
final menuItems = [
{
'icon': Symbols.notifications,
'title': 'notifications',
'badgeCount': notificationUnreadCount.value ?? 0,
'onTap': () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
@@ -374,76 +367,97 @@ class AccountScreen extends HookConsumerWidget {
builder: (context) => const NotificationSheet(),
);
},
),
if (!isWideScreen(context))
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.files),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('files').tr(),
onTap: () {
},
{
'icon': Symbols.files,
'title': 'files',
'onTap': () {
context.goNamed('files');
},
),
if (!isWideScreen(context))
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.group),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('realms').tr(),
onTap: () {
},
{
'icon': Symbols.group,
'title': 'realms',
'onTap': () {
context.goNamed('realmList');
},
),
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.wallet),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('wallet').tr(),
onTap: () {
},
{
'icon': Symbols.wallet,
'title': 'wallet',
'onTap': () {
context.pushNamed('wallet');
},
),
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.people),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('relationships').tr(),
onTap: () {
},
{
'icon': Symbols.people,
'title': 'relationships',
'onTap': () {
context.pushNamed('relationships');
},
),
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.sticker_rounded),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('stickers').tr(),
onTap: () {
},
{
'icon': Symbols.sticker_rounded,
'title': 'stickers',
'onTap': () {
context.pushNamed('stickerMarketplace');
},
),
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.rss_feed),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('webFeeds').tr(),
onTap: () {
},
{
'icon': Symbols.rss_feed,
'title': 'webFeeds',
'onTap': () {
context.pushNamed('webFeedMarketplace');
},
},
{
'icon': Symbols.gavel,
'title': 'abuseReport',
'onTap': () {
context.pushNamed('reportList');
},
},
];
return GridView.builder(
padding: const EdgeInsets.symmetric(horizontal: 12),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 80,
crossAxisSpacing: 8,
mainAxisSpacing: 8,
),
ListTile(
minTileHeight: 48,
title: Text('abuseReport').tr(),
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
leading: const Icon(Symbols.gavel),
trailing: const Icon(Symbols.chevron_right),
onTap: () => context.pushNamed('reportList'),
itemCount: menuItems.length,
itemBuilder: (context, index) {
final item = menuItems[index];
final icon = item['icon'] as IconData;
final title = item['title'] as String;
final badgeCount = item['badgeCount'] as int?;
final onTap = item['onTap'] as VoidCallback?;
return Card(
margin: EdgeInsets.zero,
child: Tooltip(
message: title.tr(),
child: InkWell(
borderRadius: BorderRadius.circular(8),
onTap: onTap,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(icon, size: 28),
if (badgeCount != null && badgeCount > 0)
Badge.count(count: badgeCount),
],
),
),
),
),
);
},
);
},
),
const Divider(height: 1).padding(vertical: 8),
ListTile(