buildListMarker method Null safety
- BuildMetadata meta,
- TextStyleHtml tsh,
- String listStyleType,
- 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);
}