barbecue 0.0.3 copy "barbecue: ^0.0.3" to clipboard
barbecue: ^0.0.3 copied to clipboard

outdated

Render text tables for your command line applications. Use padding, spans, custom borders, ANSI colors and more!

barbecue #

pub package Build Status codecov

Render text tables for CLI-based dart applications.

Ported from Kotlin to Dart from Jake Wharton's picnic.

Features:

  • Borders (with custom styling)
  • Padding
  • Styling on table- row- or cell-level
  • Text alignment (bottom/middle/top - left/middle/right)
  • Row and column spans
  • ANSI Colors and backgrounds! (see example)

example #


print(Table(
      tableStyle: TableStyle(border: true),
      header: TableSection(rows: [
        Row(
          cells: [
            Cell("ID"),
            Cell("Name"),
            Cell("Role"),
          ],
          cellStyle: CellStyle(borderBottom: true),
        ),
      ]),
      body: TableSection(
        cellStyle: CellStyle(paddingRight: 2),
        rows: [
          Row(cells: [
            Cell("42", style: CellStyle(alignment: TextAlignment.TopRight)),
            Cell("John Doe"),
            Cell("Secret Agent")
          ]),
          Row(cells: [
            Cell("4711"),
            Cell("Leanna E. Distefano"),
            Cell("Customer Support")
          ]),
          Row(cells: [Cell("1337"), Cell("Patrice Miller"), Cell("Accountant")])
        ],
      )).render());

Prints:

┌─────────────────────────────────────────────┐
│ID    Name                 Role              │
├─────────────────────────────────────────────┤
│  42  John Doe             Secret Agent      │
│4711  Leanna E. Distefano  Customer Support  │
│1337  Patrice Miller       Accountant        │
└─────────────────────────────────────────────┘
11
likes
0
pub points
95%
popularity

Publisher

verified publisherlittlebat.dev

Render text tables for your command line applications. Use padding, spans, custom borders, ANSI colors and more!

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

characters, collection, meta

More

Packages that depend on barbecue