buildListMarker method Null safety

Widget? buildListMarker(
  1. BuildMetadata meta,
  2. TextStyleHtml tsh,
  3. String listStyleType,
  4. int index
)

Builds marker widget for a list item.

Implementation

Widget? buildListMarker(
  BuildMetadata meta,
  TextStyleHtml tsh,
  String listStyleType,
  int index,
) {
  final text = getListMarkerText(listStyleType, index);
  final style = tsh.style;
  return text.isNotEmpty
      ? RichText(
          maxLines: 1,
          softWrap: false,
          text: TextSpan(style: style, text: text),
          textDirection: tsh.textDirection,
        )
      : listStyleType == kCssListStyleTypeCircle
          ? HtmlListMarker.circle(style)
          : listStyleType == kCssListStyleTypeSquare
              ? HtmlListMarker.square(style)
              : HtmlListMarker.disc(style);
}