From 877001b802e2692cf362c1f1cbbe08e862fcdaa3 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 2 Nov 2025 01:36:14 +0800 Subject: [PATCH] :lipstick: Optimize publisher profile again --- lib/route.dart | 2 +- ...ub_profile.dart => publisher_profile.dart} | 39 ++++++++++++++----- ...rofile.g.dart => publisher_profile.g.dart} | 2 +- 3 files changed, 31 insertions(+), 12 deletions(-) rename lib/screens/posts/{pub_profile.dart => publisher_profile.dart} (94%) rename lib/screens/posts/{pub_profile.g.dart => publisher_profile.g.dart} (99%) diff --git a/lib/route.dart b/lib/route.dart index 47ac3fa2..4f86fe73 100644 --- a/lib/route.dart +++ b/lib/route.dart @@ -51,7 +51,7 @@ import 'package:island/screens/creators/webfeed/webfeed_list.dart'; import 'package:island/screens/poll/poll_editor.dart'; import 'package:island/screens/posts/compose.dart'; import 'package:island/screens/posts/post_detail.dart'; -import 'package:island/screens/posts/pub_profile.dart'; +import 'package:island/screens/posts/publisher_profile.dart'; import 'package:island/screens/auth/login.dart'; import 'package:island/screens/auth/create_account.dart'; import 'package:island/screens/settings.dart'; diff --git a/lib/screens/posts/pub_profile.dart b/lib/screens/posts/publisher_profile.dart similarity index 94% rename from lib/screens/posts/pub_profile.dart rename to lib/screens/posts/publisher_profile.dart index 141501e2..bb7b35d7 100644 --- a/lib/screens/posts/pub_profile.dart +++ b/lib/screens/posts/publisher_profile.dart @@ -27,7 +27,7 @@ import 'package:island/services/color_extraction.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:styled_widget/styled_widget.dart'; -part 'pub_profile.g.dart'; +part 'publisher_profile.g.dart'; class _PublisherBasisWidget extends StatelessWidget { final SnPublisher data; @@ -98,7 +98,8 @@ class _PublisherBasisWidget extends StatelessWidget { size: 16, color: Theme.of(context).colorScheme.onPrimary, ), - backgroundColor: Theme.of(context).colorScheme.primary, + backgroundColor: + Theme.of(context).colorScheme.primary, offset: Offset(0, 48), child: ProfilePictureWidget( file: data.picture, @@ -123,7 +124,15 @@ class _PublisherBasisWidget extends StatelessWidget { Row( spacing: 6, children: [ - Text(data.nick).fontSize(20), + if (data.account != null && data.type == 0) + AccountName( + account: data.account!, + textOverride: data.nick, + hideVerificationMark: true, + style: TextStyle(fontSize: 20), + ) + else + Text(data.nick).fontSize(20), if (data.verification != null) VerificationMark(mark: data.verification!), if (isWideScreen(context)) @@ -141,19 +150,23 @@ class _PublisherBasisWidget extends StatelessWidget { '@${data.name}', maxLines: 1, overflow: TextOverflow.ellipsis, - ).fontSize(14).opacity(0.85).padding(top: 4), + ).fontSize(14).opacity(0.85).padding(bottom: 2.5), if (data.type == 0 && data.account != null) Row( crossAxisAlignment: CrossAxisAlignment.center, spacing: 6, children: [ Icon( - data.type == 0 ? Symbols.person : Symbols.workspaces, + data.type == 0 + ? Symbols.person + : Symbols.workspaces, fill: 1, size: 17, ), Text( - 'publisherBelongsTo'.tr(args: ['@${data.account!.name}']), + 'publisherBelongsTo'.tr( + args: ['@${data.account!.name}'], + ), ).fontSize(14), ], ).opacity(0.85), @@ -185,7 +198,9 @@ class _PublisherBasisWidget extends StatelessWidget { : 'subscribe', ).tr(), style: ButtonStyle( - visualDensity: VisualDensity(vertical: -2), + visualDensity: VisualDensity( + vertical: -2, + ), ), ), error: (_, _) => const SizedBox(), @@ -196,12 +211,14 @@ class _PublisherBasisWidget extends StatelessWidget { child: SizedBox( width: 20, height: 20, - child: CircularProgressIndicator(strokeWidth: 2), + child: CircularProgressIndicator( + strokeWidth: 2, + ), ), ), ), ) - .padding(vertical: 8), + .padding(vertical: 12), ], ), ), @@ -596,7 +613,9 @@ class PublisherProfileScreen extends HookConsumerWidget { child: _PublisherBioWidget(data: data), ), SliverToBoxAdapter( - child: _PublisherHeatmapWidget(heatmap: heatmap).padding(vertical: 4), + child: _PublisherHeatmapWidget( + heatmap: heatmap, + ).padding(vertical: 4), ), SliverPostList(pubName: name, pinned: true), SliverToBoxAdapter( diff --git a/lib/screens/posts/pub_profile.g.dart b/lib/screens/posts/publisher_profile.g.dart similarity index 99% rename from lib/screens/posts/pub_profile.g.dart rename to lib/screens/posts/publisher_profile.g.dart index 76d4e702..3cf50153 100644 --- a/lib/screens/posts/pub_profile.g.dart +++ b/lib/screens/posts/publisher_profile.g.dart @@ -1,6 +1,6 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'pub_profile.dart'; +part of 'publisher_profile.dart'; // ************************************************************************** // RiverpodGenerator