build method

List<Widget> build(
  1. String html
)

Implementation

List<Widget> build(String html) {
  _pageOffset = 0;
  _pageTextBuf.clear();
  final fixedHtml = _fixXhtml(html);
  final doc = html_parser.parse(fixedHtml);
  final body = doc.body ?? doc.documentElement;
  if (body == null) return [Text(html, style: _baseStyle)];

  final widgets = <Widget>[];
  _collectWidgets(body, widgets);
  if (widgets.isEmpty) {
    final text = body.text.trim();
    if (text.isNotEmpty) {
      widgets.add(Text(text, style: _baseStyle, textAlign: textAlign));
    }
  }
  return widgets;
}