Renderer.create constructor
Creates a Renderer.
Set testing to true to redirect all native render output to /dev/null.
Useful in test harnesses that capture render state via direct buffer
access and do not want ANSI sequences written to stdout.
Implementation
factory Renderer.create(int width, int height, {bool testing = false}) {
final bindings = OpenTuiBindings();
final ptr = bindings.createRenderer(width, height, testing: testing);
if (ptr == nullptr) {
throw StateError(
'Failed to create renderer. Ensure libopentui is installed and loadable.',
);
}
return Renderer._(bindings, ptr);
}