1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 22:39:22 +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, color: Colors.white,
size: 14, size: 14,
), ),
onSelected: _menuOptionSelected, onSelected: (v) => _menuOptionSelected(context, v),
itemBuilder: (c) => <PopupMenuItem<_MenuChoices>>[ itemBuilder: (c) => <PopupMenuItem<_MenuChoices>>[
PopupMenuItem( PopupMenuItem(
enabled: (message.message?.content ?? "") != "", enabled: (message.message?.content ?? "") != "",
@ -117,14 +117,16 @@ class ConversationMessageTile extends StatelessWidget {
} }
/// Process menu choice /// Process menu choice
void _menuOptionSelected(_MenuChoices value) { void _menuOptionSelected(BuildContext context, _MenuChoices value) {
switch (value) { switch (value) {
case _MenuChoices.COPY_MESSAGE: case _MenuChoices.COPY_MESSAGE:
FlutterClipboard.copy(message.message.content); FlutterClipboard.copy(message.message.content);
snack(context, tr("'${message.message.content}' copied to clipboard!"));
break; break;
case _MenuChoices.COPY_URL: case _MenuChoices.COPY_URL:
FlutterClipboard.copy(message.file.url); FlutterClipboard.copy(message.file.url);
snack(context, tr("'${message.file.url}' copied to clipboard!"));
break; break;
case _MenuChoices.GET_STATS: case _MenuChoices.GET_STATS:

View File

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