buildListMarker method

Widget? buildListMarker(
  1. BuildTree tree,
  2. InheritedProperties resolved,
  3. String listStyleType,
  4. int index,
)

Builds marker widget for a list item.

Implementation

Widget? buildListMarker(
  BuildTree tree,
  InheritedProperties resolved,
  String listStyleType,
  int index,
) {
  final text = getListMarkerText(listStyleType, index);
  final textStyle = resolved.style;
  if (text.isNotEmpty) {
    return buildText(tree, resolved, TextSpan(style: textStyle, text: text));
  }

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