Search packages, repositories and app categories

Package detailsv2.0.1

dolumns

A Dart library for formatting text output into columns. Useful for printing tabular data in a terminal.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
2.1K
Likes
22
Pub points
145

Install package

flutter pub add dolumns

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Dolumns is a Dart library designed to format text output into aligned columns, making it ideal for displaying tabular data in terminal environments. It provides simple and efficient tools to structure text with consistent spacing and alignment, enhancing readability of console-based applications. The library is lightweight and platform-agnostic, supporting all major Flutter platforms including Android, iOS, Web, macOS, Windows, and Linux. It's particularly useful for CLI tools, debug outputs, or any application requiring clean textual layouts without external dependencies.

Use cases

  • Displaying command-line tables
  • Formatting debug logs
  • Creating terminal dashboards
  • Generating reports in CLI apps
  • Presenting structured data in console

Key features

  • Easy column alignment
  • Flexible padding and spacing
  • Cross-platform compatibility
  • Minimal API surface
  • Supports custom separators
  • No external dependencies

Suitable for

  • CLI tool developers
  • Console-based applications
  • Debugging utilities
  • Data visualization in terminals
  • Educational or learning tools

Considerations

  • Not suitable for GUI table rendering
  • Limited styling options
  • Best for monospaced fonts
  • Does not support advanced formatting like colors
  • Primarily intended for simple text layout
  • Requires manual handling of line wrapping

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

A library for formatting text output into columns.

Dart CI

Usage

A simple usage example:

import 'package:dolumns/dolumns.dart';

main() {
  final columns = dolumnify([
    ['provider', '4.0.2'],
    ['http', '0.12.0+4'],
    ['shared_preferences', '0.5.6+1'],
    ['sentry', '3.0.1'],
  ]);
  print(columns);
}

will output:

provider            4.0.2   
http                0.12.0+4
shared_preferences  0.5.6+1 
sentry              3.0.1   

You can also supply a custom column splitter, (...], columnSplitter: ' | '); will give:

provider           | 4.0.2   
http               | 0.12.0+4
shared_preferences | 0.5.6+1 
sentry             | 3.0.1 

Columns with headers are possible with a custom header separator, provide the header in the first list item:

import 'package:dolumns/dolumns.dart';

main() {
  final columns = dolumnify([
    ['PACKAGES', 'VERSION'],
    ['provider', '4.0.2'],
    ['http', '0.12.0+4'],
    ['shared_preferences', '0.5.6+1'],
    ['sentry', '3.0.1'],
  ], columnSplitter: ' | ', headerIncluded: true, headerSeparator: '=');
  print(columns);
}

will output:

PACKAGES           | VERSION 
=============================
provider           | 4.0.2   
http               | 0.12.0+4
shared_preferences | 0.5.6+1 
sentry             | 3.0.1   

see dolumns_example.dart example file for full details.

Note you can pass in objects of any type, dolumn will call toString() on every object passed in.

API inspired by the columinfy npm package.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Categories

Source repository

Projects using this package

No data available yet.