パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v4.1.0

console

コンソールアプリケーションに必要な一般的な機能を提供するライブラリで、色のフォーマット、キーボード入力、プログレスバーが含まれます。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
38万
いいね数
70
Pub ポイント
120

パッケージをインストール

flutter pub add console

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

console パッケージは、Dart および Flutter でコマンドラインアプリケーションを構築するための基本的なユーティリティを提供します。カラーテキスト出力、インタラクティブなキーボード入力処理、プログレスバーの可視化などの機能を備えています。CLI 開発者向けに設計されており、クリーンでクロスプラットフォーム対応の API を使ってターミナルとのやり取りを簡素化しています。Android、iOS、macOS、Windows、Linux など複数のプラットフォームをサポートしており、UI 環境外で実行されるツールに最適です。軽量な性質と開発者体験への注力により、スクリプト作成、自動化、コンソールベースのワークフローに実用的な選択肢となります。

用途

  • CLI ツールの構築
  • インタラクティブターミナルアプリケーション
  • スクリプト内の進行状況のトラッキング
  • カラーロギング
  • コマンドラインユーザー入力の処理

主な機能

  • カラーフォーマットのサポート
  • キーボード入力ユーティリティ
  • プログレスバー コンポーネント
  • クロスプラットフォーム互換性
  • シンプルな API デザイン

適している対象

  • CLI開発者
  • スクリプトツール
  • オートメーションワークフロー
  • ターミナルベースのインターフェース
  • Dart/Flutter コンソールアプリ

注意事項

  • コンソール環境に限定
  • GUIの統合なし
  • ターミナルアクセスが必要です
  • プラットフォーム固有の動作が可能です
  • WebやモバイルUIには対応していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Console

A high-level console library.

Features

  • Console Colors (ANSI)
  • Icons (UTF-8)
  • Keyboard Capture
  • Experimental Clipboard Support
  • Progress Bars
  • Flexible Prompts
  • Shell Prompts
  • Choosers
  • Fancy Formatting
  • Loading Bars
  • Timer (like pub's timer)
  • Fancy Trees (like the npm dependency trees)
  • Simple Unit Testing

Usage

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...
}

Unit Testing

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');
    });
  });
}

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト