setComponentParam method

void setComponentParam(
  1. BrownfieldSelection selection,
  2. String paramName,
  3. Object? value
)

Binds a component instance parameter to a DSL value or expression.

The selection must target a component instance node. The paramName must match a declared parameter on that component. The value can be any DSL expression: State(...), PageParam(...), ItemRef()['field'], string literals, boolean expressions, etc.

page.setComponentParam(
  page.findByName('FilterChip'),
  'active',
  Equals(State('selectedFilter'), 'all'),
);

Implementation

void setComponentParam(
  BrownfieldSelection selection,
  String paramName,
  Object? value,
) {
  _operations.add(
    _SetComponentParamSpec(
      selection: selection,
      paramName: paramName,
      value: normalizeExpression(value),
    ),
  );
}