toText method

String toText({
  1. String onChar = '#',
  2. bool forCode = false,
})

Converts the matrix to a text representation.

This method creates a string representation of the matrix where each true cell is represented by the specified character.

Parameters:

  • onChar: The character to use for representing true cells. Defaults to '#'.
  • forCode: Whether the output is intended for code representation. Defaults to false.

Returns a formatted string representation of the matrix.

Implementation

String toText({final String onChar = '#', final bool forCode = false}) {
  return gridToString(forCode: forCode, onChar: onChar);
}