addIcon method

RichTextGenerator addIcon(
  1. Widget? icon, {
  2. PlaceholderAlignment? alignment,
})

icon 图标 alignment 图标的对齐方式 默认是顶部对齐

Implementation

RichTextGenerator addIcon(
  Widget? icon, {
  PlaceholderAlignment? alignment,
}) {
  _spanList.add(
    WidgetSpan(
      alignment: alignment ?? PlaceholderAlignment.top,
      child: icon ?? const SizedBox.shrink(),
    ),
  );
  return this;
}