htmlBodySmall method
Widget
htmlBodySmall(
- dynamic text,
- dynamic context, {
- dynamic color,
- int? maxLines,
})
Implementation
Widget htmlBodySmall(text, context, {color, int? maxLines}) {
return Html(
data: text,
style: {
"body": Style(
padding: HtmlPaddings.all(0),
margin: Margins.zero,
maxLines: maxLines,
fontSize: FontSize(smallText),
textOverflow: maxLines != null ? TextOverflow.ellipsis : null,
lineHeight: LineHeight(textHeight),
color: Theme.of(context).textTheme.bodySmall!.color,
),
"html": Style(padding: HtmlPaddings.all(0), margin: Margins.zero),
"div": Style(
padding: HtmlPaddings.all(0),
backgroundColor: Colors.transparent,
fontFamily: Theme.of(context).textTheme.bodyMedium!.fontFamily,
fontWeight: regularWeight,
color: Theme.of(context).textTheme.bodySmall!.color,
lineHeight: LineHeight(textHeight),
fontSize: FontSize(regularText)),
"ul": Style(
listStyleType: ListStyleType.disc,
),
"p": Style(
fontSize: FontSize(regularText),
),
"small": Style(fontSize: FontSize(smallText)),
"a": Style(
color: Theme.of(context).colorScheme.primary,
fontSize: FontSize(smallText))
},
onLinkTap: (url, v1, v2) async {
await Utils.launchUrl(url);
},
);
}