resize method
Reallocates the target at a new size. Consumers pick up the new textures on the next render; the next update check re-renders regardless of policy so the target is never displayed stale-sized.
Implementation
void resize(int width, int height) {
assert(width > 0 && height > 0, 'RenderTexture size must be positive');
final newSize = ui.Size(width.toDouble(), height.toDouble());
if (newSize == _size) {
return;
}
_size = newSize;
// The Surface ring detects the size change on next acquire; force a
// re-render so manual/interval targets don't keep a stale-sized image.
_updateRequested = true;
}