Skip to content
pubscout

cli_table

1.0.2, released 3 years ago by marinvitlov.com

Displays static tabular data in terminal in Dart applications.

$ flutter pub add cli_table
Source repository

What it does

A Dart package that enhances the user experience by displaying static tabular data in terminal. It supports horizontal, vertical, and cross table layouts, column widths, content truncation, horizontal and vertical alignment, padding, word wrapping, and per-cell customization like cell spans.

AI-written summary of version 1.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display tabular data inside a command-line interface or terminal application in Dart.
  • You require custom features like cell spans, alignments, and word wrapping in terminal tables.

Skip it when

  • You are building a graphical user interface (GUI) or mobile app using Flutter widgets.

Strengths

  • Supports multiple table layouts including horizontal, vertical, and cross tables.
  • Provides extensive cell customization such as column/row spans, alignments, and word wrapping.
  • Integrates color and background styling via chalkdart.

Weaknesses

  • Limited to terminal applications and static tabular data display.
  • Not intended for graphical Flutter UI layouts.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4
import 'package:cli_table/cli_table.dart';

void main() {
  final table = Table(
    header: ['Rel', 'Change', 'By', 'When'],
    columnWidths: [10, 20, 20, 30],
  );

  table
    ..add(['v0.1', 'First test', 'someone@gmail.com', '9 minutes ago'])
    ..add(['v0.1', 'Second test', 'other@gmail.com', '13 minutes ago']);

  print(table.toString());
}

Alternatives

Packages that do the same job and could replace cli_table.

  • console

    Another option for console and terminal-related utilities in Dart.

Works with

Packages commonly used together with cli_table: ones it builds on, ones built on it, and its own family.