build method

  1. @override
InlineSpan build()
override

Implementation

@override
InlineSpan build() {
  final align = attribute['align'] ?? '';
  InlineSpan result = childrenSpan;
  if (align.contains('left')) {
    result = WidgetSpan(
        child: Align(
            alignment: Alignment.centerLeft,
            child: ProxyRichText(
              childrenSpan,
              richTextBuilder: visitor.richTextBuilder,
            )));
  } else if (align.contains('center')) {
    result = WidgetSpan(
        child: Align(
            alignment: Alignment.center,
            child: ProxyRichText(
              childrenSpan,
              richTextBuilder: visitor.richTextBuilder,
            )));
  } else if (align.contains('right')) {
    result = WidgetSpan(
        child: Align(
            alignment: Alignment.centerRight,
            child: ProxyRichText(
              childrenSpan,
              richTextBuilder: visitor.richTextBuilder,
            )));
  }
  return result;
}