Terminal class
An old school terminal that can be displayed in an html document.
Constructors
-
Terminal({required int rows, required int columns, required HTMLElement container, int rowGap = 2, bool scrolls = true, String defaultColor = 'white', String backgroundColor = 'black', bool isInteractive = true, int pixelWidth = 2, int pixelHeight = 2, Map<
String, List< ? fontData, void whenMouseIsClicked(Terminal, MouseData)?, void whenMouseIsMoved(Terminal, MouseData)?, void whenMouseEntersTerminal(Terminal, MouseData)?, void whenMouseLeavesTerminal(Terminal, MouseData)?, void whenKeyIsPressed(Terminal, KeyboardData)?, void whenKeyIsReleased(Terminal, KeyboardData)?})int> >
Properties
- backgroundColor → String
-
The background color of the terminal.
final
- blur → void Function()
-
Removes focus from the terminal.
no setter
- columns → int
-
The number of columns in the terminal.
final
- container → HTMLElement
-
The DOM element that will contain the terminal.
final
- currentPosition → Position
-
The current position of the terminal's cursor.
final
- defaultColor → String
-
The default color of terminal display.
final
- focus → void Function()
-
Gives the terminal focus.
no setter
- hasFocus → bool
-
Whether the terminal has focus.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInteractive → bool
-
Whether the terminal is interactive.
final
- rowGap → int
-
The number of pixels between rows.
final
- rows → int
-
The number of rows in the terminal.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screen ↔ Screen
-
The terminal screen.
latefinal
- scrolls → bool
-
Whether the terminal scrolls when output is sent to the last row.
final
Methods
-
clear(
{int row = 0, int column = 0, int? width, int? height}) → void -
Clears the terminal over the region defined by
rectangleif set; otherwise clears the whole terminal. -
getCharacter(
{required int row, required int column}) → String -
Returns the character at row
row, columncolumn. -
getColor(
{required int row, required int column}) → String -
Returns the color at row
row, columncolumn. -
input(
{String? prompt, int? row, int? column, String? color, int length = 1}) → Future< String> - Waits for the user to input a string and then returns the result. Throws a TerminalInputException if the terminal is not ready for input.
-
inputKey(
) → Future< KeyboardData> - Waits for the user to input a key and then returns the result. Throws a TerminalInputException if the terminal is not ready for input.
-
inputMouseClick(
) → Future< MouseData> - Waits for the user to input a mouse click and then returns the result. Throws a TerminalInputException if the terminal is not ready for input.
-
newLine(
) → void - Moves the cursor to the beginning of the next row.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
output(
String text, {int? row, int? column, String? color, bool newLineAfter = true}) → void - Outputs text to the terminal.
-
pokeCharacter(
{required int row, required int column, required List< int> data, String? color}) → void -
Pokes an 8-byte character defined by
datato the terminal. -
scroll(
[int n = 1]) → void - Scrolls the terminal data up by a row.
-
setCharacter(
{required int row, required int column, required String character}) → void -
Updates the character data at row
row, columncolumn. -
setColor(
{required int row, required int column, required String color}) → void -
Updates the color data at row
row, columncolumn. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited