editComponent method

void editComponent(
  1. String name,
  2. void build(
    1. BrownfieldWidgetEditor component
    )
)

Queues rerunnable structural edits against an existing component.

Implementation

void editComponent(
  String name,
  void Function(BrownfieldWidgetEditor component) build,
) {
  recordExistingReference(
    name: name,
    kind: 'component',
    referenceApi: 'editComponent',
    removeApi: 'removeComponent',
  );
  final editor = BrownfieldWidgetEditor._(
    scopeKind: _WidgetClassScopeKind.component,
    widgetClassName: name,
  );
  build(editor);
  raw((project) => _applyBrownfieldWidgetClassEdit(project, editor));
}