SneathConsole class abstract
A representation of the current console window.
Use the SneathConsole to get information about the current window and to read and write to it.
A comprehensive set of demos of using the Console class can be found in the
examples/
subdirectory.
- Implementers
Constructors
Properties
- cursor_position → SneathCursorPositionDelegate
-
Provides ways to retrieve and update the cursor position.
no setter
- dimensions → SneathConsoleDimensions
-
Contains information about the width and height of the window.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- new_line → String
-
Returns the current newline string.
no setter
- raw_mode → bool
-
Returns whether the terminal is in raw mode.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear_screen(
) → void - Clears the entire screen
-
cursor_down(
) → void - Moves the cursor one position down.
-
cursor_left(
) → void - Moves the cursor one position to the left.
-
cursor_right(
) → void - Moves the cursor one position to the right.
-
cursor_up(
) → void - Moves the cursor one position up.
-
erase_cursor_to_end(
) → void - Erases the current line from the cursor to the end of the line.
-
erase_line(
) → void - Erases all the characters in the current line.
-
hide_cursor(
) → void - Hides the cursor.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read_key(
) → Key - Reads a single key from the input, including a variety of control characters.
-
read_line(
{bool cancel_on_break, bool cancel_on_escape, bool cancel_on_eof, void callback(String text, Key lastPressed)?}) → String? - Reads a line of input, handling basic keyboard navigation commands.
-
reset_color_attributes(
) → void - Resets all color attributes and text styles to the default terminal setting.
-
reset_cursor_position(
) → void - Moves the cursor to the top left corner of the screen.
-
set_background_color(
AnsiBackgroundColor background) → void - Sets the console background color to a named ANSI color.
-
set_background_extended_color(
AnsiExtendedColorPalette color) → void - Sets the background to one of 256 extended ANSI colors.
-
set_foreground_color(
AnsiForegroundColor foreground) → void - Sets the console foreground color to a named ANSI color.
-
set_foreground_extended_color(
AnsiExtendedColorPalette color) → void - Sets the foreground to one of 256 extended ANSI colors.
-
set_raw_mode(
bool value) → void - Enables or disables raw mode.
-
set_text_style(
{bool bold, bool underscore, bool blink, bool inverted}) → void - Sets the text style.
-
show_cursor(
) → void - Shows the cursor.
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
String text) → void - Writes the text to the console.
-
write_error_line(
String text) → void - Writes an error message to the console, with newline automatically appended.
-
write_line(
[String? text, ConsoleTextAlignment alignment]) → void - Writes a line to the console, optionally with alignment provided by the ConsoleTextAlignment enumeration.
-
write_line_centered(
String? text) → void -
write_lines(
Iterable< String> lines, ConsoleTextAlignment alignment) → void -
write_lines_centered(
Iterable< String> lines) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited