mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-25 22:39:22 +00:00
Improve messages appearance
This commit is contained in:
parent
c1196a6359
commit
201200299c
@ -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:
|
||||||
|
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user