buildListItem function

Widget buildListItem(
  1. BuildContext context,
  2. OpenUiNode node
)

Implementation

Widget buildListItem(BuildContext context, OpenUiNode node) {
  final props = node.props;
  final theme = node.theme;
  final inRich =
      context.dependOnInheritedWidgetOfExactType<_ListRowScope>()?.rich ??
      false;
  final fontSize = DefaultTextStyle.of(context).style.fontSize ?? 14;
  final description = props.string('description') ?? '';
  final children = node.children();
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      _richText(
        context,
        node,
        props.string('title') ?? '',
        TextStyle(fontWeight: inRich ? theme.typography.medium : null),
      ),
      if (description.isNotEmpty) ...[
        const SizedBox(height: 2),
        _richText(
          context,
          node,
          description,
          _textStyle(
            theme,
            color: theme.muted,
            size: fontSize * 0.93,
            height: 1.55,
          ),
        ),
      ],
      if (children.isNotEmpty) ...[const SizedBox(height: 8), ...children],
    ],
  );
}