buildListMarker method

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

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;
  if (text.isNotEmpty) {
    return RichText(
      maxLines: 1,
      softWrap: false,
      text: TextSpan(style: style, text: text),
      textDirection: tsh.textDirection,
    );
  }

  switch (listStyleType) {
    case kCssListStyleTypeCircle:
      return HtmlListMarker.circle(style);
    case kCssListStyleTypeNone:
      return null;
    case kCssListStyleTypeSquare:
      return HtmlListMarker.square(style);
    case kCssListStyleTypeDisc:
    default:
      return HtmlListMarker.disc(style);
  }
}