💄 Optimize publisher profile again
This commit is contained in:
@@ -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/poll/poll_editor.dart';
|
||||||
import 'package:island/screens/posts/compose.dart';
|
import 'package:island/screens/posts/compose.dart';
|
||||||
import 'package:island/screens/posts/post_detail.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/login.dart';
|
||||||
import 'package:island/screens/auth/create_account.dart';
|
import 'package:island/screens/auth/create_account.dart';
|
||||||
import 'package:island/screens/settings.dart';
|
import 'package:island/screens/settings.dart';
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import 'package:island/services/color_extraction.dart';
|
|||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
part 'pub_profile.g.dart';
|
part 'publisher_profile.g.dart';
|
||||||
|
|
||||||
class _PublisherBasisWidget extends StatelessWidget {
|
class _PublisherBasisWidget extends StatelessWidget {
|
||||||
final SnPublisher data;
|
final SnPublisher data;
|
||||||
@@ -98,7 +98,8 @@ class _PublisherBasisWidget extends StatelessWidget {
|
|||||||
size: 16,
|
size: 16,
|
||||||
color: Theme.of(context).colorScheme.onPrimary,
|
color: Theme.of(context).colorScheme.onPrimary,
|
||||||
),
|
),
|
||||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
offset: Offset(0, 48),
|
offset: Offset(0, 48),
|
||||||
child: ProfilePictureWidget(
|
child: ProfilePictureWidget(
|
||||||
file: data.picture,
|
file: data.picture,
|
||||||
@@ -123,7 +124,15 @@ class _PublisherBasisWidget extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
spacing: 6,
|
spacing: 6,
|
||||||
children: [
|
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)
|
if (data.verification != null)
|
||||||
VerificationMark(mark: data.verification!),
|
VerificationMark(mark: data.verification!),
|
||||||
if (isWideScreen(context))
|
if (isWideScreen(context))
|
||||||
@@ -141,19 +150,23 @@ class _PublisherBasisWidget extends StatelessWidget {
|
|||||||
'@${data.name}',
|
'@${data.name}',
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
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)
|
if (data.type == 0 && data.account != null)
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
spacing: 6,
|
spacing: 6,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
data.type == 0 ? Symbols.person : Symbols.workspaces,
|
data.type == 0
|
||||||
|
? Symbols.person
|
||||||
|
: Symbols.workspaces,
|
||||||
fill: 1,
|
fill: 1,
|
||||||
size: 17,
|
size: 17,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'publisherBelongsTo'.tr(args: ['@${data.account!.name}']),
|
'publisherBelongsTo'.tr(
|
||||||
|
args: ['@${data.account!.name}'],
|
||||||
|
),
|
||||||
).fontSize(14),
|
).fontSize(14),
|
||||||
],
|
],
|
||||||
).opacity(0.85),
|
).opacity(0.85),
|
||||||
@@ -185,7 +198,9 @@ class _PublisherBasisWidget extends StatelessWidget {
|
|||||||
: 'subscribe',
|
: 'subscribe',
|
||||||
).tr(),
|
).tr(),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
visualDensity: VisualDensity(vertical: -2),
|
visualDensity: VisualDensity(
|
||||||
|
vertical: -2,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
error: (_, _) => const SizedBox(),
|
error: (_, _) => const SizedBox(),
|
||||||
@@ -196,12 +211,14 @@ class _PublisherBasisWidget extends StatelessWidget {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 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),
|
child: _PublisherBioWidget(data: data),
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: _PublisherHeatmapWidget(heatmap: heatmap).padding(vertical: 4),
|
child: _PublisherHeatmapWidget(
|
||||||
|
heatmap: heatmap,
|
||||||
|
).padding(vertical: 4),
|
||||||
),
|
),
|
||||||
SliverPostList(pubName: name, pinned: true),
|
SliverPostList(pubName: name, pinned: true),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
part of 'pub_profile.dart';
|
part of 'publisher_profile.dart';
|
||||||
|
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
Reference in New Issue
Block a user