update method

bool update(
  1. CanvasChildId id, {
  2. Offset? position,
  3. double? rotation,
  4. Size? childSize,
  5. Widget? widget,
})

Apply supplied fields atomically. Null fields leave existing values unchanged. Returns whether anything changed; changed updates notify exactly once. rotation is clockwise radians around the layout center.

Implementation

bool update(
  CanvasChildId id, {
  Offset? position,
  double? rotation,
  Size? childSize,
  Widget? widget,
}) {
  final child = _requireChild(id);
  _validateGeometry(
    position: position,
    rotation: rotation,
    childSize: childSize,
  );
  final changed = _updateChild(
    child,
    id,
    position: position,
    rotation: rotation,
    childSize: childSize,
    widget: widget,
  );
  if (changed) markDirty();
  return changed;
}