Optimized chat

This commit is contained in:
LittleSheep 2024-06-05 23:55:21 +08:00
parent ca1a8a04cb
commit df7dd85a0c
3 changed files with 62 additions and 70 deletions

View File

@ -339,7 +339,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
Expanded(
child: PagedListView<int, Message>(
reverse: true,
clipBehavior: Clip.none,
pagingController: _pagingController,
builderDelegate: PagedChildBuilderDelegate<Message>(
itemBuilder: buildHistory,
@ -351,8 +350,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
),
Positioned(
bottom: math.max(MediaQuery.of(context).padding.bottom, 16),
left: 16,
right: 16,
left: 0,
right: 0,
child: ChatMessageInput(
edit: _messageToEditing,
reply: _messageToReplying,

View File

@ -116,8 +116,6 @@ class ChatMessage extends StatelessWidget {
item.sender.account.nick,
style: const TextStyle(fontWeight: FontWeight.bold),
),
const SizedBox(width: 4),
Text(format(item.createdAt, locale: 'en_short')),
Expanded(child: buildContent()),
],
);

View File

@ -157,8 +157,6 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
@override
Widget build(BuildContext context) {
const borderRadius = BorderRadius.all(Radius.circular(20));
final notifyBannerActions = [
TextButton(
onPressed: resetInput,
@ -167,13 +165,11 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
];
return Material(
borderRadius: borderRadius,
elevation: 2,
child: ClipRRect(
borderRadius: borderRadius,
color: Theme.of(context).colorScheme.surface,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Divider(thickness: 0.3, height: 0.3),
if (_replyTo != null)
MaterialBanner(
leading: const FaIcon(FontAwesomeIcons.reply, size: 18),
@ -228,11 +224,10 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
onPressed: () => sendMessage(),
)
],
).paddingOnly(left: 16, right: 4),
).paddingOnly(left: 20, right: 16),
),
],
),
),
);
}
}