update method

void update(
  1. BrownfieldSelection selection,
  2. void build(
    1. BrownfieldWidgetPatch patch
    )
)

Applies a typed property patch to an existing widget.

Implementation

void update(
  BrownfieldSelection selection,
  void Function(BrownfieldWidgetPatch patch) build,
) {
  final patch = BrownfieldWidgetPatch._();
  build(patch);
  if (patch._isEmpty) {
    throw ArgumentError('update(...) requires at least one property patch.');
  }
  _operations.add(_PatchSpec(selection: selection, patch: patch._freeze()));
}