如何使用Flutter编写带有项目符号点的段落?

问题描述:

使用HTML,我可以在这样的段落中添加一个项目符号:

Using HTML I can add a bullet points to a paragraph like this:

<ul>
   <li> example </li>
   <li> example </li>
   <li> example </li>
<ul>

如何在Flutter中编写项目符号表格?

How can I write bullet point form in Flutter?

new Text(''),

为此使用降价是过大的.到目前为止,使用字符更加容易.

Using markdown for this is overkill. Using character is by far easier.

如果您懒得复制粘贴字符,这是一个自定义的Text,可以为您完成此操作:

If you're too lazy to copy paste the character, here's a custom Text that does it for you:

class Bullet extends Text {
  const Bullet(
    String data, {
    Key key,
    TextStyle style,
    TextAlign textAlign,
    TextDirection textDirection,
    Locale locale,
    bool softWrap,
    TextOverflow overflow,
    double textScaleFactor,
    int maxLines,
    String semanticsLabel,
  }) : super(
          '• ${data}',
          key: key,
          style: style,
          textAlign: textAlign,
          textDirection: textDirection,
          locale: locale,
          softWrap: softWrap,
          overflow: overflow,
          textScaleFactor: textScaleFactor,
          maxLines: maxLines,
          semanticsLabel: semanticsLabel,
        );
}