Skip to content

[flutter_markdown] Ensure customize nested bullet list style. #145670

@Kurogoma4D

Description

@Kurogoma4D

Use case

When rendering Markdown, it's common practice (as GitHub does) to change the style of nested ordered list.


  1. first
  2. second
    1. first
      1. first
      2. second
    2. first
      1. second
raw:
1. first
2. second
   1. first
      1. first
      2. second
   1. first
      1. second

However, flutter_markdown does not support it, so different styles cannot be applied at each level of nesting.

Proposal

If the bulletBuilder property is passed the nesting level as a parameter, it should be possible to customize the widget on the application side.

Example:

bulletBuilder: (int index, BulletStyle style, int nestLevel) => switch (style) {
  BulletStyle.unorderedList => const Text('・'),
  BulletStyle.orderedList => Text('${index + 1}-$nestLevel.'),
}

I followed the process from the Markdown widget, and since the nesting level is already managed internally.
So I think it can be implemented and gonna create some Pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: flutter_markdownflutter/packages flutter_markdownpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions