Hopefully fix font size & link colour

This commit is contained in:
Sorunome
2020-05-15 05:47:32 +00:00
committed by Christian Pauly
parent cacc0c4854
commit 6184c60d80
3 changed files with 23 additions and 8 deletions

View File

@ -7,19 +7,25 @@ import 'matrix.dart';
class HtmlMessage extends StatelessWidget {
final String html;
final Color textColor;
final int maxLines;
final Room room;
final TextStyle defaultTextStyle;
final TextStyle linkStyle;
const HtmlMessage({this.html, this.textColor, this.maxLines, this.room});
const HtmlMessage({this.html, this.maxLines, this.room, this.defaultTextStyle, this.linkStyle});
@override
Widget build(BuildContext context) {
// there is no need to pre-validate the html, as we validate it while rendering
final themeData = Theme.of(context);
return Html(
data: html,
defaultTextStyle: TextStyle(color: textColor),
defaultTextStyle: defaultTextStyle,
linkStyle: linkStyle ?? themeData.textTheme.bodyText2.copyWith(
color: themeData.accentColor,
decoration: TextDecoration.underline,
),
shrinkToFit: true,
maxLines: maxLines,
onLinkTap: (String url) {