Compare commits
3 Commits
develop-gr
...
develop-fi
Author | SHA1 | Date | |
---|---|---|---|
f3de0bc165 | |||
8000475c1f | |||
da772f17cc |
@ -206,7 +206,7 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !message.containsFile,
|
||||
visible: widget.bubbleData.message != '{file}',
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.copy),
|
||||
title: const Text('Nachricht kopieren'),
|
||||
|
@ -21,22 +21,29 @@ class ChatMessage {
|
||||
ChatMessage({required this.originalMessage, this.originalData}) {
|
||||
if(originalData?.containsKey('file') ?? false) {
|
||||
file = originalData?['file'];
|
||||
content = file?.name ?? 'Datei';
|
||||
} else {
|
||||
content = RichObjectStringProcessor.parseToString(originalMessage, originalData);
|
||||
}
|
||||
content = RichObjectStringProcessor.parseToString(originalMessage, originalData);
|
||||
}
|
||||
|
||||
Widget getWidget() {
|
||||
|
||||
if(file == null) {
|
||||
return Linkify(
|
||||
var contentWidget = Linkify(
|
||||
text: content,
|
||||
onOpen: onOpen,
|
||||
);
|
||||
}
|
||||
|
||||
return Padding(padding: const EdgeInsets.only(top: 5), child: CachedNetworkImage(
|
||||
if(file == null) return contentWidget;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
errorWidget: (context, url, error) => Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@ -53,7 +60,14 @@ class ChatMessage {
|
||||
fadeOutDuration: Duration.zero,
|
||||
errorListener: (value) {},
|
||||
imageUrl: 'https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/index.php/core/preview?fileId=${file!.id}&x=100&y=-1&a=1',
|
||||
));
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(height: 5),
|
||||
contentWidget
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> onOpen(LinkableElement link) async {
|
||||
|
Reference in New Issue
Block a user