dart_console
5.1.2, released 4 weeks ago by onepub.dev
A helper library for command-line applications requiring advanced control over input/output.
What it does
Provides control over console window dimensions, cursor location, colors, raw input mode, and tabular data display. It includes features for reading control sequences, handling East Asian character widths, and streaming key input asynchronously.
AI-written summary of version 5.1.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building command-line applications or REPLs in Dart
- Needing raw keyboard input processing or cursor manipulation
- Displaying formatted tabular data or calendars in the terminal
Skip it when
- Developing graphical user interface (GUI) or mobile applications
- Building web-only applications
Strengths
- Supports raw terminal mode and advanced keyboard input processing
- Cross-platform support for Windows, macOS, and Linux
- Includes built-in support for table rendering and calendar display
Weaknesses
- Requires a terminal that recognizes and implements common ANSI escape sequences
- Platform-specific bindings rely on FFI and the win32 package on Windows
Setup
- Kind
- FFI (native library)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Not documented
import 'package:dart_console/dart_console.dart';
main() {
final console = Console();
console.clearScreen();
console.resetCursorPosition();
console.writeLine(
'Console size is \${console.windowWidth} cols and \${console.windowHeight} rows.',
TextAlignment.center,
);
console.writeLine();
return 0;
}Alternatives
Packages that do the same job and could replace dart_console.
- cli_util
Utilities to help build Dart command-line apps, find the SDK, and display progress.
88Compare - cli_tools
Utilities for building command‑line interfaces, including argument parsing, analytics, and progress reporting.
83Compare - icons_launcher
A command-line tool that simplifies updating your Flutter app launcher icon.
71Compare - bosun
Library for parsing CLI input and structuring commands
40Compare
Works with
Packages commonly used together with dart_console: ones it builds on, ones built on it, and its own family.
- ffidart_console depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- intldart_console depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- win32dart_console depends on itCall common Windows APIs and COM objects directly from Dart using FFI.
- charactersdart_console depends on itUnicode and grapheme cluster aware string manipulation operations for Dart.
- interactBuilt on dart_consoleCustomizable interactive command-line components for Dart
- fvmBuilt on dart_consoleCLI to manage Flutter SDK versions per project
- dcliBuilt on dart_consoleA Dart SDK for building cross‑platform command line applications and scripts.
- onepubBuilt on dart_consoleCommand line tools for the OnePub private Dart and Flutter package repository.