Add Link text

This commit is contained in:
Christian Pauly
2020-01-04 08:37:09 +00:00
parent 2c047d9b21
commit 2cc29e7004
4 changed files with 28 additions and 21 deletions

View File

@ -3,6 +3,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:link_text/link_text.dart';
import 'package:url_launcher/url_launcher.dart';
import 'matrix.dart';
@ -85,11 +86,20 @@ class MessageContent extends StatelessWidget {
? "You: "
: "${event.sender.calcDisplayname()}: "
: "";
return Text(
senderPrefix + event.getBody(),
maxLines: maxLines,
overflow: textOnly ? TextOverflow.ellipsis : null,
style: TextStyle(
if (textOnly) {
return Text(
senderPrefix + event.getBody(),
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),
);
}
return LinkText(
text: senderPrefix + event.getBody(),
textStyle: TextStyle(
color: textColor,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),