parseJsonChildrenWidget function

List<Widget> parseJsonChildrenWidget(
  1. List children
)

Implementation

List<Widget> parseJsonChildrenWidget(List<dynamic> children) {
  return children.map<Widget>(
    (child) {
      switch (child['type']) {
        case 'heading':
          return _ParseParagraph(
            child: child,
            lineType: child['tag'] == 'h1' ? LineType.h1 : LineType.h2,
          );
        case 'paragraph':
          return _ParseParagraph(child: child);
        case 'quote':
          return _ParseParagraph(child: child);
        case 'table':
          return ParseTable(child: child);
        case 'list':
          return _ParseNumberedList(child: child);
        case 'listitem':
          return _ParseParagraph(child: child);
        default:
          return const SizedBox.shrink();
      }
    },
  ).toList();
}