ConsoleStrings class
Provides a set of strings for controlling the console. Function names follow the naming convention of the ANSI escape codes.
Outside of this class,
- "move" is used instead of "cursor"
- "clear" is used instead of "erase"
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- cursorToHome ↔ String
-
Moves the cursor to the top left.
getter/setter pair
- deviceStatusReport ↔ String
-
Returns the cursor position in
ESC[n;mR
format where n is the row and m is the column.getter/setter pair - eraseCurrentToEndLine ↔ String
-
Erases from the current cursor position to the end of the line.
getter/setter pair
- eraseCurrentToEndScreen ↔ String
-
Erases from the current cursor position to the end of the screen.
getter/setter pair
- eraseCurrentToStartLine ↔ String
-
Erases from the current cursor position to the start of the line.
getter/setter pair
- eraseCurrentToStartScreen ↔ String
-
Erases from the current cursor position to the start of the screen.
getter/setter pair
- eraseLine ↔ String
-
Erases the entire current line. Cursor position does not change.
getter/setter pair
- eraseScreen ↔ String
-
Erases the entire screen.
Moves the cursor to the top left (only on DOS with ANSI.SYS).
getter/setter pair
- eraseScreenClearScrollback ↔ String
-
Erases the entire screen and clears the scrollback buffer.
getter/setter pair
- resetColor ↔ String
-
Resets the current color setting.
getter/setter pair
Static Methods
-
cursorBackward(
[int n = 1]) → String -
Moves the cursor backward (left) by
n
columns; the default is 1. If the cursor is already at the edge of the screen, this has no effect. -
cursorDown(
[int n = 1]) → String -
Moves the cursor down by
n
rows; the default is 1. If the cursor is already at the edge of the screen, this has no effect. -
cursorForward(
[int n = 1]) → String -
Moves the cursor forward (right) by
n
columns; the default is 1. If the cursor is already at the edge of the screen, this has no effect. -
cursorNextLine(
[int n = 1]) → String -
Moves the cursor to the beginning of the line
n
lines down (default 1). -
cursorPrevLine(
[int n = 1]) → String -
Moves the cursor to the beginning of the line
n
lines up (default 1). -
cursorTo(
int x, int y) → String - Moves the cursor to the specific position (x, y). Indices start at 1, not 0.
-
cursorToColumn(
int n) → String - Moves the cursor to column n.
-
cursorUp(
[int n = 1]) → String -
Moves the cursor up by
n
rows; the default is 1. If the cursor is already at the edge of the screen, this has no effect. -
eraseDisplayNative(
int n) → String - Native erase display sequence. Use eraseCurrentToEndScreen, eraseCurrentToStartScreen, eraseScreen, eraseScreenClearScrollback for convenience.
-
eraseLineNative(
int n) → String - Native erase line sequence.
-
scrollDown(
int n) → String - Scroll down by n lines. New lines are added at the top.
-
scrollUp(
int n) → String - Scroll up by n lines. New lines are added at the bottom.
-
setBackgroundColorNative256(
int colorCode) → String - Native 256 color sequence to set the background color.
-
setColor(
{SimpleColor? foreground, SimpleColor? background}) → String - Set the foreground and background color (type-safe).
-
setColorNative(
{int? foreground, int? background}) → String - Native color sequence.
-
setForegroundColorNative256(
int colorCode) → String - Native 256 color sequence to set the foreground color.