Skip to content

ResponsiveTable

Category: UI

Source: responsive_table.dart

Width-aware wrapper over [TableFormatter]. Holds rows + column spec; produces header/row strings for any requested content width. Cheap to re-query: the last format() call is cached, so consecutive queries at the same width reuse the same TableRender.

Classes

ResponsiveTable

Constructor

dart
ResponsiveTable({
    required this.columns,
    required List<T> rows,
    required Map<String, String> Function(T row) getValues,
    this.gap = '  ',
    this.includeDivider = true,
    this.includeHeaderInWidth = false,
  })

Properties

PropertyTypeDescription
columnsList&lt;TableColumn&gt;
gapString
includeDividerbool
includeHeaderInWidthbool
rowCountint get
rowCountint get

Methods

T sourceAt(int index)
List&lt;String&gt; renderHeader(int width)
String renderRow(int index, int width)

Released under the MIT License.