barbecue 0.3.0-alpha1 copy "barbecue: ^0.3.0-alpha1" to clipboard
barbecue: ^0.3.0-alpha1 copied to clipboard

outdated

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());
}
14
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, string_validator

More

Packages that depend on barbecue