💄 Optimize some designs

This commit is contained in:
2025-09-01 23:05:11 +08:00
parent f2d780b48f
commit 4252f66fd3
5 changed files with 64 additions and 15 deletions

View File

@@ -68,6 +68,7 @@ class AccountScreen extends HookConsumerWidget {
body: SingleChildScrollView(
padding: getTabbedPadding(context),
child: Column(
spacing: 4,
children: <Widget>[
Card(
child: Column(
@@ -112,20 +113,22 @@ class AccountScreen extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
AccountName(
Flexible(
child: AccountName(
account: user.value!,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
Text('@${user.value!.name}'),
),
Flexible(child: Text('@${user.value!.name}')),
],
),
Text(
(user.value!.profile.bio.isNotEmpty)
? user.value!.profile.bio
: 'No description yet.',
: 'descriptionNone'.tr(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -158,8 +161,16 @@ class AccountScreen extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Symbols.draw, size: 28).padding(bottom: 8),
Text('creatorHub').tr().fontSize(16).bold(),
Text('creatorHubDescription').tr(),
Text(
'creatorHub',
maxLines: 1,
overflow: TextOverflow.ellipsis,
).tr().fontSize(16).bold(),
Text(
'creatorHubDescription',
maxLines: 2,
overflow: TextOverflow.ellipsis,
).tr(),
],
).padding(horizontal: 16, vertical: 12),
onTap: () {
@@ -176,8 +187,16 @@ class AccountScreen extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Symbols.code, size: 28).padding(bottom: 8),
Text('developerPortal').tr().fontSize(16).bold(),
Text('developerPortalDescription').tr(),
Text(
'developerPortal',
maxLines: 1,
overflow: TextOverflow.ellipsis,
).tr().fontSize(16).bold(),
Text(
'developerPortalDescription',
maxLines: 2,
overflow: TextOverflow.ellipsis,
).tr(),
],
).padding(horizontal: 16, vertical: 12),
onTap: () {

View File

@@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'package:gap/gap.dart';
@@ -297,6 +298,18 @@ class AccountProfileScreen extends HookConsumerWidget {
],
),
),
InkWell(
child: Row(
spacing: 6,
children: [
Icon(Symbols.fingerprint, size: 17, fill: 1).padding(right: 2),
Text(data.id),
],
),
onTap: () {
Clipboard.setData(ClipboardData(text: data.id));
},
),
];
}

View File

@@ -1394,6 +1394,8 @@ class ChatRoomScreen extends HookConsumerWidget {
],
);
const messageKeyPrefix = 'message-';
Widget chatMessageListWidget(List<LocalChatMessage> messageList) =>
SuperListView.builder(
listController: listController,
@@ -1403,7 +1405,9 @@ class ChatRoomScreen extends HookConsumerWidget {
itemCount: messageList.length,
findChildIndexCallback: (key) {
final valueKey = key as ValueKey;
final messageId = valueKey.value as String;
final messageId = (valueKey.value as String).substring(
messageKeyPrefix.length,
);
return messageList.indexWhere((m) => m.id == messageId);
},
extentEstimation: (_, _) => 40,
@@ -1420,10 +1424,13 @@ class ChatRoomScreen extends HookConsumerWidget {
.abs() >
3;
final key = ValueKey('$messageKeyPrefix${message.id}');
return chatIdentity.when(
skipError: true,
data:
(identity) => MessageItem(
key: key,
message: message,
isCurrentUser: identity?.id == message.senderId,
onAction: (action) {
@@ -1466,6 +1473,7 @@ class ChatRoomScreen extends HookConsumerWidget {
),
loading:
() => MessageItem(
key: key,
message: message,
isCurrentUser: false,
onAction: null,
@@ -1473,7 +1481,7 @@ class ChatRoomScreen extends HookConsumerWidget {
showAvatar: false,
onJump: (_) {},
),
error: (_, _) => const SizedBox.shrink(),
error: (_, _) => SizedBox.shrink(key: key),
);
},
);

View File

@@ -37,7 +37,14 @@ class AccountName extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
spacing: 4,
children: [
Flexible(child: Text(account.nick, style: nameStyle)),
Flexible(
child: Text(
account.nick,
style: nameStyle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
if (account.perkSubscription != null)
StellarMembershipMark(membership: account.perkSubscription!),
if (account.profile.verification != null)

View File

@@ -60,7 +60,9 @@ class AccountStatusCreationWidget extends HookConsumerWidget {
spacing: 4,
children: [
Icon(Symbols.keyboard_arrow_up),
Text('statusCreateHint').tr(),
Expanded(
child: Text('statusCreateHint', maxLines: 1).tr(),
),
],
),
).opacity(0.85),