Compare commits
No commits in common. "develop-fileMessagesWithText" and "develop" have entirely different histories.
develop-fi
...
develop
@ -21,25 +21,22 @@ class ChatMessage {
|
|||||||
ChatMessage({required this.originalMessage, this.originalData}) {
|
ChatMessage({required this.originalMessage, this.originalData}) {
|
||||||
if(originalData?.containsKey('file') ?? false) {
|
if(originalData?.containsKey('file') ?? false) {
|
||||||
file = originalData?['file'];
|
file = originalData?['file'];
|
||||||
}
|
content = file?.name ?? 'Datei';
|
||||||
|
} else {
|
||||||
content = RichObjectStringProcessor.parseToString(originalMessage, originalData);
|
content = RichObjectStringProcessor.parseToString(originalMessage, originalData);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Widget getWidget() {
|
Widget getWidget() {
|
||||||
|
|
||||||
var contentWidget = Linkify(
|
if(file == null) {
|
||||||
|
return Linkify(
|
||||||
text: content,
|
text: content,
|
||||||
onOpen: onOpen,
|
onOpen: onOpen,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if(file == null) return contentWidget;
|
return Padding(padding: const EdgeInsets.only(top: 5), child: CachedNetworkImage(
|
||||||
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 5),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
CachedNetworkImage(
|
|
||||||
errorWidget: (context, url, error) => Row(
|
errorWidget: (context, url, error) => Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@ -56,12 +53,7 @@ class ChatMessage {
|
|||||||
fadeOutDuration: Duration.zero,
|
fadeOutDuration: Duration.zero,
|
||||||
errorListener: (value) {},
|
errorListener: (value) {},
|
||||||
imageUrl: 'https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/index.php/core/preview?fileId=${file!.id}&x=100&y=-1&a=1',
|
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 {
|
Future<void> onOpen(LinkableElement link) async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user