diff --git a/lib/screens/account.dart b/lib/screens/account.dart index 16ad8e78..bd2e2718 100644 --- a/lib/screens/account.dart +++ b/lib/screens/account.dart @@ -68,6 +68,7 @@ class AccountScreen extends HookConsumerWidget { body: SingleChildScrollView( padding: getTabbedPadding(context), child: Column( + spacing: 4, children: [ Card( child: Column( @@ -112,20 +113,22 @@ class AccountScreen extends HookConsumerWidget { crossAxisAlignment: CrossAxisAlignment.baseline, textBaseline: TextBaseline.alphabetic, children: [ - AccountName( - account: user.value!, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, + 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: () { diff --git a/lib/screens/account/profile.dart b/lib/screens/account/profile.dart index 7be0ac81..a2ca9705 100644 --- a/lib/screens/account/profile.dart +++ b/lib/screens/account/profile.dart @@ -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)); + }, + ), ]; } diff --git a/lib/screens/chat/room.dart b/lib/screens/chat/room.dart index edf0389a..54938d2c 100644 --- a/lib/screens/chat/room.dart +++ b/lib/screens/chat/room.dart @@ -1394,6 +1394,8 @@ class ChatRoomScreen extends HookConsumerWidget { ], ); + const messageKeyPrefix = 'message-'; + Widget chatMessageListWidget(List 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), ); }, ); diff --git a/lib/widgets/account/account_name.dart b/lib/widgets/account/account_name.dart index 1b5c9542..127741f6 100644 --- a/lib/widgets/account/account_name.dart +++ b/lib/widgets/account/account_name.dart @@ -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) diff --git a/lib/widgets/account/status.dart b/lib/widgets/account/status.dart index 5b649777..4e73f5f5 100644 --- a/lib/widgets/account/status.dart +++ b/lib/widgets/account/status.dart @@ -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),