dart_console2 library

Console library.

Provides enhanced console capabilities for a CLI application that wants to do more than write plain text to stdout.

Console manipulation

The Console class provides simple methods to control the cursor position, hide the cursor, change the foreground or background color, clear the terminal display, read individual keys without echoing to the terminal, erase text and write aligned text to the screen.

Table display

The Table class allows two-dimensional data sets to be displayed in a tabular form, with headers, custom box characters and line drawing, row and column formatting and manipulation.

Calendar

The Calendar class displays a monthly calendar, with options for controlling color and whether the current date is highlighted.

Progress Bar

The ProgressBar class presents a progress bar for long-running operations, optionally including a spinner. It supports headless displays (where it is silent), as well as interactive consoles, and can be adjusted for custom presentation.

The class works on any desktop environment that supports ANSI escape characters, and has some fallback capabilities for older versions of Windows that use traditional console APIs.

Classes

BoxGlyphSet
Calendar
Console
A representation of the current console window.
Coordinate
A screen position, measured in rows and columns from the top-left origin of the screen. Coordinates are zero-based, and converted as necessary for the underlying system representation (e.g. one-based for VT-style displays).
Key
A representation of a keystroke.
ProgressBar
A facility for drawing a progress bar in the terminal.
ScrollbackBuffer
The ScrollbackBuffer class is a utility for handling multi-line user input in readline(). It doesn't support history editing a la bash, but it should handle the most common use cases.
Table
An experimental class for drawing tables. The API is not final yet.

Enums

BorderStyle
BorderType
ConsoleColor
ControlCharacter
Non-printable characters that can be entered from the keyboard.
FontStyle
TextAlignment
Text alignments for line output.

Extensions

StringUtils on String