💄 Sending message indicator

This commit is contained in:
LittleSheep 2024-06-29 18:40:26 +08:00
parent df2f04d2b2
commit 85bba21285
2 changed files with 29 additions and 4 deletions

View File

@ -167,6 +167,7 @@ class SolianMessages extends Translations {
'Your notification settings has been applied.',
'messageUnsync': 'Messages Un-synced',
'messageUnsyncCaption': '@count message(s) still in un-synced.',
'messageSending': 'Sending...',
'messageEditDesc': 'Edited message @id',
'messageDeleteDesc': 'Deleted message @id',
'messageCallStartDesc': '@user starts a call',
@ -386,7 +387,7 @@ class SolianMessages extends Translations {
'channelNotifyLevelApplied': '你的通知设置已经应用。',
'messageUnsync': '消息未同步',
'messageUnsyncCaption': '还有 @count 条消息未同步',
'messageDecoding': '解码信息中…',
'messageSending': '消息发送中…',
'messageEditDesc': '修改了消息 @id',
'messageDeleteDesc': '删除了消息 @id',
'messageCallStartDesc': '@user 发起了一次通话',

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
import 'package:solian/controllers/chat_events_controller.dart';
@ -124,12 +125,24 @@ class ChatEvent extends StatelessWidget {
Widget buildBody(BuildContext context) {
if (isContentPreviewing || (isMerged && !isQuote)) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (item.body['quote_event'] != null && chatController != null)
buildQuote(),
buildContent(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: buildContent()),
if (item.isPending)
const SizedBox(
width: 12,
height: 12,
child: CircularProgressIndicator(strokeWidth: 2),
),
],
),
],
);
).paddingOnly(right: 12);
} else if (isQuote) {
return Card(
child: Row(
@ -203,7 +216,18 @@ class ChatEvent extends StatelessWidget {
if (item.body['quote_event'] != null &&
chatController != null)
buildQuote(),
buildContent(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: buildContent()),
if (item.isPending)
const SizedBox(
width: 12,
height: 12,
child: CircularProgressIndicator(strokeWidth: 2),
),
],
),
],
),
),