runWithOutput<T> method
Runs body with a RenderOutput, clearing output at the end if requested.
Implementation
T runWithOutput<T>(
T Function(RenderOutput out) body, {
bool clearOnEnd = false,
}) {
final out = RenderOutput();
start();
try {
return body(out);
} finally {
end();
if (clearOnEnd) out.clear();
}
}