1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 04:49:21 +00:00

Improve messages appearance

This commit is contained in:
Pierre HUBERT 2021-03-13 08:37:59 +01:00
parent c1196a6359
commit 201200299c
2 changed files with 9 additions and 4 deletions

View File

@ -62,7 +62,7 @@ class ConversationMessageTile extends StatelessWidget {
color: Colors.white,
size: 14,
),
onSelected: _menuOptionSelected,
onSelected: (v) => _menuOptionSelected(context, v),
itemBuilder: (c) => <PopupMenuItem<_MenuChoices>>[
PopupMenuItem(
enabled: (message.message?.content ?? "") != "",
@ -117,14 +117,16 @@ class ConversationMessageTile extends StatelessWidget {
}
/// Process menu choice
void _menuOptionSelected(_MenuChoices value) {
void _menuOptionSelected(BuildContext context, _MenuChoices value) {
switch (value) {
case _MenuChoices.COPY_MESSAGE:
FlutterClipboard.copy(message.message.content);
snack(context, tr("'${message.message.content}' copied to clipboard!"));
break;
case _MenuChoices.COPY_URL:
FlutterClipboard.copy(message.file.url);
snack(context, tr("'${message.file.url}' copied to clipboard!"));
break;
case _MenuChoices.GET_STATS:

View File

@ -36,8 +36,11 @@ class _ConversationFileWidgetState extends State<ConversationFileWidget> {
@override
Widget build(BuildContext context) => Stack(
children: [
!file.hasThumbnail
? Container()
!file.hasThumbnail ||
file.fileType == ConversationMessageFileType.IMAGE
? Container(
width: 0,
)
: Opacity(
opacity: 0.8,
child: CachedNetworkImage(