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

View File

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

View File

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

View File

@@ -352,21 +352,14 @@ class AccountScreen extends HookConsumerWidget {
}, },
), ),
), ),
ListTile( Builder(
minTileHeight: 48, builder: (context) {
leading: const Icon(Symbols.notifications), final menuItems = [
trailing: const Icon(Symbols.chevron_right), {
contentPadding: EdgeInsets.symmetric(horizontal: 24), 'icon': Symbols.notifications,
title: Row( 'title': 'notifications',
children: [ 'badgeCount': notificationUnreadCount.value ?? 0,
Expanded(child: Text('notifications').tr()), 'onTap': () {
Badge.count(
count: notificationUnreadCount.value ?? 0,
isLabelVisible: (notificationUnreadCount.value ?? 0) > 0,
),
],
),
onTap: () {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
@@ -374,76 +367,97 @@ class AccountScreen extends HookConsumerWidget {
builder: (context) => const NotificationSheet(), builder: (context) => const NotificationSheet(),
); );
}, },
), },
if (!isWideScreen(context)) {
ListTile( 'icon': Symbols.files,
minTileHeight: 48, 'title': 'files',
leading: const Icon(Symbols.files), 'onTap': () {
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('files').tr(),
onTap: () {
context.goNamed('files'); context.goNamed('files');
}, },
), },
if (!isWideScreen(context)) {
ListTile( 'icon': Symbols.group,
minTileHeight: 48, 'title': 'realms',
leading: const Icon(Symbols.group), 'onTap': () {
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('realms').tr(),
onTap: () {
context.goNamed('realmList'); context.goNamed('realmList');
}, },
), },
ListTile( {
minTileHeight: 48, 'icon': Symbols.wallet,
leading: const Icon(Symbols.wallet), 'title': 'wallet',
trailing: const Icon(Symbols.chevron_right), 'onTap': () {
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('wallet').tr(),
onTap: () {
context.pushNamed('wallet'); context.pushNamed('wallet');
}, },
), },
ListTile( {
minTileHeight: 48, 'icon': Symbols.people,
leading: const Icon(Symbols.people), 'title': 'relationships',
trailing: const Icon(Symbols.chevron_right), 'onTap': () {
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('relationships').tr(),
onTap: () {
context.pushNamed('relationships'); context.pushNamed('relationships');
}, },
), },
ListTile( {
minTileHeight: 48, 'icon': Symbols.sticker_rounded,
leading: const Icon(Symbols.sticker_rounded), 'title': 'stickers',
trailing: const Icon(Symbols.chevron_right), 'onTap': () {
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('stickers').tr(),
onTap: () {
context.pushNamed('stickerMarketplace'); context.pushNamed('stickerMarketplace');
}, },
), },
ListTile( {
minTileHeight: 48, 'icon': Symbols.rss_feed,
leading: const Icon(Symbols.rss_feed), 'title': 'webFeeds',
trailing: const Icon(Symbols.chevron_right), 'onTap': () {
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('webFeeds').tr(),
onTap: () {
context.pushNamed('webFeedMarketplace'); 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( itemCount: menuItems.length,
minTileHeight: 48, itemBuilder: (context, index) {
title: Text('abuseReport').tr(), final item = menuItems[index];
contentPadding: const EdgeInsets.symmetric(horizontal: 24), final icon = item['icon'] as IconData;
leading: const Icon(Symbols.gavel), final title = item['title'] as String;
trailing: const Icon(Symbols.chevron_right), final badgeCount = item['badgeCount'] as int?;
onTap: () => context.pushNamed('reportList'), 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), const Divider(height: 1).padding(vertical: 8),
ListTile( ListTile(