v2.0.1
dolumns
텍스트 출력을 열로 포맷하기 위한 Dart 라이브러리입니다. 터미널에서 표 형식 데이터를 출력하는 데 유용합니다.
22좋아요 1.9천30일 다운로드145Pub 점수
AndroidiOSWebmacOSWindowsLinux
텍스트 출력을 열로 형식화하는 데 사용되는 라이브러리입니다.
^1.11.1^1.24.2아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A library for formatting text output into columns.
Dart CI
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.
Please file feature requests and bugs at the issue tracker.