TablePrinter class
Helper class for formatting text as a table of rows with aligned columns. It supports an optional header.
- Implementers
Constructors
-
TablePrinter.new({Iterable<
String?> ? headers, Iterable<int?> ? columnMinWidths, Iterable<List< ? rows, String? columnSeparator, String? headerDividerColumnSeparator})String?> > -
TablePrinter.columns({required Iterable<
List< rows, String? columnSeparator})String?> > - Convenience constructor for creating a table with aligned columns and no header. By default the columns are separated by a single space.
Properties
Methods
-
addHeaders(
Iterable< String?> headers) → void - Adds column headers to the table. Can be called multiple times.
-
addRow(
Iterable< String?> row) → void - Adds a row to the table. Can be called multiple times.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toStream(
Stream< Iterable< ? rowStream, {int? limit}) → Stream<String> >String> - Converts the table content to a stream of formatted strings, one for each row.
-
toString(
) → String -
Converts the table content to a formatted string,
with rows separated by newlines.
override
-
writeLines(
void lineSink(String)) → void - Puts the table content to the provided sink line by line. The line strings are not terminated with a newline.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultColumnSeparator → const String
- defaultHeaderDividerColumnSeparator → const String