Merge branch 'develop' into fix/send-anim-duration

This commit is contained in:
Salvatore Giordano
2021-02-26 09:45:53 +01:00
committed by GitHub
12 changed files with 604 additions and 28 deletions
@@ -103,11 +103,25 @@ class ImageActionsModal extends StatelessWidget {
color: StreamChatTheme.of(context).colorTheme.accentRed,
),
() {
Navigator.pop(context);
Navigator.pop(context);
StreamChannel.of(context)
.channel
.deleteMessage(message);
final channel = StreamChannel.of(context).channel;
if (message.attachments.length > 1 ||
message.text.isNotEmpty) {
final remainingAttachments = [...message.attachments]
..removeAt(currentIndex);
channel.updateMessage(message.copyWith(
attachments: remainingAttachments.map((e) {
return e.copyWith(
uploadState: UploadState.success());
}).toList(),
));
Navigator.pop(context);
Navigator.pop(context);
} else {
channel.deleteMessage(message).then((value) {
Navigator.pop(context);
Navigator.pop(context);
});
}
},
color: StreamChatTheme.of(context).colorTheme.accentRed,
),
@@ -418,19 +418,21 @@ class MessageInputState extends State<MessageInput> {
),
splashRadius: 24,
),
secondChild: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
if (!widget.disableAttachments) _buildAttachmentButton(),
if (widget.editMessage == null &&
StreamChannel.of(context)
.channel
?.config
?.commands
?.isNotEmpty ==
true)
_buildCommandButton(),
].insertBetween(const SizedBox(width: 8)),
secondChild: FittedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
if (!widget.disableAttachments) _buildAttachmentButton(),
if (widget.editMessage == null &&
StreamChannel.of(context)
.channel
?.config
?.commands
?.isNotEmpty ==
true)
_buildCommandButton(),
].insertBetween(const SizedBox(width: 8)),
),
),
duration: Duration(milliseconds: 300),
alignment: Alignment.center,
@@ -2013,6 +2015,7 @@ class MessageInputState extends State<MessageInput> {
if (_commandEnabled) {
text = '/${_chosenCommand.name} ' + text;
FocusScope.of(context).unfocus();
}
final attachments = [..._attachments.values];
@@ -199,10 +199,7 @@ class StreamChatThemeData {
),
),
color: colorTheme.white,
title: TextStyle(
fontSize: 14,
color: colorTheme.black,
),
title: textTheme.headlineBold,
lastMessageAt: TextStyle(
fontSize: 11,
color: colorTheme.black.withOpacity(.5),
@@ -257,7 +254,7 @@ class StreamChatThemeData {
actionButtonIdleColor: colorTheme.grey,
sendButtonColor: colorTheme.accentBlue,
sendButtonIdleColor: colorTheme.greyGainsboro,
inputBackground: colorTheme.white.withAlpha(12),
inputBackground: colorTheme.white,
),
reactionIcons: [
ReactionIcon(