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<String?>>? rows, String? columnSeparator, String? headerDividerColumnSeparator})
TablePrinter.columns({required Iterable<List<String?>> rows, String? columnSeparator})
Convenience constructor for creating a table with aligned columns and no header. By default the columns are separated by a single space.

Properties

hashCode int
The hash code for this object.
no setterinherited
rowCount int
Gets the number of rows currently added to this table.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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<String>>? rowStream, {int? limit}) Stream<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