superSmallHTMLText method

Widget superSmallHTMLText(
  1. dynamic text,
  2. dynamic context, {
  3. dynamic color,
  4. dynamic textAlign,
  5. int? maxLines,
})

Implementation

Widget superSmallHTMLText(text, context, {color, textAlign, int? maxLines}) {
  return Html(
    data: text,
    style: {
      "body": Style(
        padding: HtmlPaddings.all(0),
        margin: Margins.zero,
        maxLines: maxLines,
        fontSize: FontSize(xsText),
        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(xsText)),
      "ul": Style(
        listStyleType: ListStyleType.disc,
      ),
      "p": Style(
        fontSize: FontSize(xsText),
      ),
      "small": Style(fontSize: FontSize(xsText)),
      "a": Style(
          color: Theme.of(context).colorScheme.primary,
          fontSize: FontSize(xsText))
    },
    onLinkTap: (url, v1, v2) async {
      await Utils.launchUrl(url);
    },
  );
}