li function

Component li(
  1. List<Component> children, {
  2. int? value,
  3. Key? key,
  4. String? id,
  5. String? classes,
  6. Styles? styles,
  7. Map<String, String>? attributes,
  8. Map<String, EventCallback>? events,
})

The <li> HTML element is used to represent an item in a list. It must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). In menus and unordered lists, list items are usually displayed using bullet points. In ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter.

  • value: This integer attribute indicates the current ordinal value of the list item as defined by the <ol> element. The only allowed value for this attribute is a number, even if the list is displayed with Roman numerals or letters. List items that follow this one continue numbering from the value set. The value attribute has no meaning for unordered lists (<ul>) or for menus (<menu>).

Implementation

Component li(List<Component> children,
    {int? value,
    Key? key,
    String? id,
    String? classes,
    Styles? styles,
    Map<String, String>? attributes,
    Map<String, EventCallback>? events}) {
  return DomComponent(
    tag: 'li',
    key: key,
    id: id,
    classes: classes,
    styles: styles,
    attributes: {
      ...attributes ?? {},
      if (value != null) 'value': '$value',
    },
    events: events,
    children: children,
  );
}