buildForm function

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

Implementation

Widget buildForm(BuildContext context, OpenUiNode node) {
  final theme = node.theme;
  final items = _slot(
    _items(node, node.props['children']),
    parent: SlotParent.other,
    flow: false,
  );
  return node.form(
    Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      spacing: theme.spacing.fieldGap,
      children: [
        for (final (i, item) in items.indexed)
          i == items.length - 1 && _isAction(item)
              ? Padding(
                  key: item.siblingKey,
                  padding: EdgeInsets.only(
                    top: theme.spacing.actionGap - theme.spacing.fieldGap,
                  ),
                  child: item.widget,
                )
              : item.widget,
      ],
    ),
  );
}