Hopefully fix font size & link colour
This commit is contained in:
committed by
Christian Pauly
parent
cacc0c4854
commit
6184c60d80
@ -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) {
|
||||
|
Reference in New Issue
Block a user