RenderConfig class TUI

Rendering configuration for display-only UI building blocks.

Carries terminal state needed to render components correctly:

Bubble models render plain strings from view(). These components follow the same convention by rendering to strings and letting the caller decide how to print them (or compose them into a parent model's view).

Example

final config = RenderConfig(
  terminalWidth: 120,
  colorProfile: ColorProfile.ansi256,
  hasDarkBackground: false, // Light terminal
);

final alert = Alert.warning('Low disk space', renderConfig: config);
print(alert.render());

In addition to interactive models, Artisanal provides DisplayComponents. These are simple string renderers that don't handle input but provide consistent styling for tables, lists, and panels.

Use RenderConfig to adapt these components to the current terminal width and color capabilities.

Constructors

RenderConfig({int terminalWidth = 80, ColorProfile colorProfile = ColorProfile.trueColor, bool hasDarkBackground = true})
Creates a render configuration with the given settings.
const
RenderConfig.fromRenderer(Renderer renderer, {int terminalWidth = 80})
Creates a RenderConfig from a Renderer's detected settings.
factory

Properties

colorProfile ColorProfile
Terminal color capabilities for ANSI output.
final
hasDarkBackground bool
Whether the terminal has a dark background.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
terminalWidth int
Terminal width in columns for text wrapping and layout.
final

Methods

configureStyle(Style style) Style
Configures a Style with this config's color profile and background.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited