dolumns 1.0.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 67

A library for formatting text output into columns.

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 

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.

1.0.1+1 #

  • Improve description in pubspec

1.0.1 #

  • Allow specifying a custom column splitter string
  • Improve documentation

1.0.0 #

  • Initial version

example/dolumns_example.dart

import 'package:dolumns/dolumns.dart';

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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dolumns: ^1.0.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dolumns/dolumns.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
33
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Mar 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
Dev dependencies
pedantic ^1.8.0
test ^1.6.0