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

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

example/lib/example.dart

import 'package:barbecue/barbecue.dart';
import 'package:ansicolor/ansicolor.dart';

void main(List<String> arguments) {
  final redPen = AnsiPen()
    ..red(bold: true)
    ..gray(bg: true, level: 0.1);
  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(redPen("Secret Agent"))
          ]),
          Row(cells: [
            Cell("4711"),
            Cell("Leanna E. Distefano"),
            Cell("Customer Support")
          ]),
          Row(cells: [Cell("1337"), Cell("Patrice Miller"), Cell("Accountant")])
        ],
      )).render());
}
28
likes
150
points
31.9k
downloads

Documentation

API reference

Publisher

verified publisherlittlebat.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

characters, collection, meta, string_validator

More

Packages that depend on barbecue