Cell constructor

Cell(
  1. [String symbol = ' ',
  2. Style style = Style.reset]
)

Creates a new cell with the given symbol and optional style.

The symbol must be exactly 1 character long.

If no style is provided, the cell will inherit the style of its parent.

Implementation

factory Cell([String symbol = ' ', Style style = Style.reset]) {
  if (symbol.length != 1 && symbol.characters.length != 1) {
    throw ArgumentError.value(
      symbol,
      'symbol',
      'must be exactly 1 character',
    );
  }
  return Cell._(symbol, style);
}