v4.1.0
console
一個用於終端應用程式的常見功能庫,包括顏色格式化、鍵盤輸入和進度條。
70喜歡 18.3萬近 30 天下載120Pub 分數
AndroidiOSmacOSWindowsLinux
控制台庫
^2.1.0^1.16.8^1.11.0以下為英文專案原文快照,最新內容請造訪 GitHub。
A high-level console library.
This library does not work in browsers (for a hopefully obvious reason).
import "package:console/console.dart";
void main() {
// Initialize the Console. Throws an exception if advanced terminal features are not supported.
Console.init();
// Use the library...
}
You can test the output produced by this library (and thus your own project that uses this library). Here is an example:
import "package:test/test.dart";
import "package:console/console.dart";
void main() {
final output = new BufferConsoleAdapter();
setUpAll(() => Console.adapter = output);
// Clear output between test runs
setUp(() => output.clear());
group('base functions', () {
test('centerCursor', () {
Console.centerCursor();
expect(output.toString(), '${Console.ANSI_ESCAPE}10;40H');
});
});
}