getFinalChildren static method

List<Widget> getFinalChildren(
  1. BuildContext context,
  2. dynamic nodeState,
  3. List<CNode> children,
  4. FGeneralTypeInput? typeInput,
)

Implementation

static List<Widget> getFinalChildren(
    BuildContext context,
    WidgetState nodeState,
    List<CNode> children,
    FGeneralTypeInput? typeInput) {
  if (typeInput == null) {
    return getChildren(context, nodeState, children);
  }
  if (children.isEmpty) {
    return getChildren(context, nodeState, children);
  }
  final itemCount = typeInput.length(
    context: context,
    loop: nodeState.loop,
  );
  final firstWidget = getChildren(context, nodeState, children).first;
  final result = <Widget>[];
  for (var i = 0; i < itemCount; i++) {
    result.add(firstWidget);
  }
  return result;
}