💄 Optimize the account page

This commit is contained in:
2025-11-02 00:51:16 +08:00
parent bc60ce5d42
commit 8d1d836b52
2 changed files with 111 additions and 64 deletions

View File

@@ -74,6 +74,9 @@ class AccountScreen extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (user.value?.profile.background?.id != null) if (user.value?.profile.background?.id != null)
Stack(
clipBehavior: Clip.none,
children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(8), topLeft: Radius.circular(8),
@@ -87,10 +90,33 @@ class AccountScreen extends HookConsumerWidget {
), ),
), ),
), ),
Row( Positioned(
bottom: -24,
left: 16,
child: GestureDetector(
child: ProfilePictureWidget(
file: user.value?.profile.picture,
radius: 32,
),
onTap: () {
context.pushNamed(
'accountProfile',
pathParameters: {'name': user.value!.name},
);
},
),
),
],
),
Builder(
builder: (context) {
final hasBackground =
user.value?.profile.background?.id != null;
return Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
spacing: 16, spacing: hasBackground ? 0 : 16,
children: [ children: [
if (!hasBackground)
GestureDetector( GestureDetector(
child: ProfilePictureWidget( child: ProfilePictureWidget(
file: user.value?.profile.picture, file: user.value?.profile.picture,
@@ -109,8 +135,7 @@ class AccountScreen extends HookConsumerWidget {
children: [ children: [
Row( Row(
spacing: 4, spacing: 4,
crossAxisAlignment: CrossAxisAlignment.baseline, crossAxisAlignment: CrossAxisAlignment.end,
textBaseline: TextBaseline.alphabetic,
children: [ children: [
Flexible( Flexible(
child: AccountName( child: AccountName(
@@ -121,7 +146,11 @@ class AccountScreen extends HookConsumerWidget {
), ),
), ),
), ),
Flexible(child: Text('@${user.value!.name}')), Flexible(
child: Text(
'@${user.value!.name}',
).fontSize(11).padding(bottom: 2.5),
),
], ],
), ),
Text( Text(
@@ -131,15 +160,25 @@ class AccountScreen extends HookConsumerWidget {
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
const Gap(12),
], ],
), ),
), ),
], ],
).padding(horizontal: 16, top: 16), ).padding(
AccountStatusCreationWidget(uname: user.value!.name), left: 16,
right: 16,
top: 16 + (hasBackground ? 16 : 0),
);
},
),
], ],
), ),
).padding(horizontal: 8), ).padding(horizontal: 8),
Card(
margin: EdgeInsets.zero,
child: AccountStatusCreationWidget(uname: user.value!.name),
).padding(horizontal: 12, bottom: 4),
LevelingProgressCard( LevelingProgressCard(
isCompact: true, isCompact: true,
level: user.value!.profile.level, level: user.value!.profile.level,

View File

@@ -84,21 +84,29 @@ class AccountStatusCreationWidget extends HookConsumerWidget {
: Padding( : Padding(
padding: padding:
padding ?? padding ??
EdgeInsets.symmetric(horizontal: 27, vertical: 4), EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row( child: Column(
spacing: 4, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [ children: [
Icon(Symbols.keyboard_arrow_up), Icon(Symbols.keyboard_arrow_up),
Expanded( SizedBox(width: 4),
child: Text('statusCreateHint', maxLines: 1).tr(), Text('Create Status').tr(),
],
), ),
SizedBox(height: 4),
Text(
'Tap to set your current activity and let others know what you\'re up to',
style: TextStyle(fontSize: 12),
).tr().opacity(0.75),
], ],
), ),
).opacity(0.85), ).opacity(0.85),
error: error:
(error, _) => Padding( (error, _) => Padding(
padding: padding:
padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 4), padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 12),
child: Row( child: Row(
spacing: 4, spacing: 4,
children: [Icon(Symbols.close), Text('Error: $error')], children: [Icon(Symbols.close), Text('Error: $error')],
@@ -107,7 +115,7 @@ class AccountStatusCreationWidget extends HookConsumerWidget {
loading: loading:
() => Padding( () => Padding(
padding: padding:
padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 4), padding ?? EdgeInsets.symmetric(horizontal: 26, vertical: 12),
child: Row( child: Row(
spacing: 4, spacing: 4,
children: [Icon(Symbols.more_vert), Text('loading').tr()], children: [Icon(Symbols.more_vert), Text('loading').tr()],