TextAreaModel class
- Inheritance
-
- Object
- Model
- ViewComponent
- TextAreaModel
Constructors
- TextAreaModel({String prompt = '│ ', String placeholder = '', bool showLineNumbers = true, int charLimit = 0, bool softWrap = true, int width = 0, int height = 6, bool useVirtualCursor = true, TextAreaKeyMap? keyMap, CursorModel? cursor, TextAreaStyles? styles})
Properties
- charLimit ↔ int
-
getter/setter pair
- column → int
-
no setter
- cursor ↔ CursorModel
-
Cursor model.
getter/setter pair
- focused → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
no setter
- keyMap ↔ TextAreaKeyMap
-
getter/setter pair
- length → int
-
no setter
- line → int
-
no setter
- lineCount → int
-
no setter
- placeholder ↔ String
-
getter/setter pair
- prompt ↔ String
-
getter/setter pair
- promptFunc ↔ PromptFunc?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showLineNumbers ↔ bool
-
getter/setter pair
- softWrap ↔ bool
-
getter/setter pair
- styles ↔ TextAreaStyles
-
Styles for the textarea.
getter/setter pair
- terminalCursor → Cursor?
-
Returns a
Cursorfor rendering a real cursor in a TUI program. This requires that useVirtualCursor is set to false.no setter - useVirtualCursor ↔ bool
-
Whether to use a virtual cursor. If false, use terminalCursor to return
a real cursor for rendering.
getter/setter pair
- value ↔ String
-
Returns the current value of the textarea.
getter/setter pair
- width → int
-
no setter
Methods
-
activeStyle(
) → TextAreaStyleState - Returns the appropriate style state based on focus.
-
blur(
) → void - Blurs the textarea.
-
cursorColumn(
) → int - Returns the current cursor column (0-indexed).
-
cursorEnd(
) → void -
cursorLine(
) → int - Returns the current cursor line (0-indexed).
-
cursorStart(
) → void -
focus(
) → Cmd? - Focuses the textarea.
-
getSelectedText(
) → String - Returns the currently selected text.
-
init(
) → Cmd? -
Returns an optional command to execute on program startup.
override
-
insertString(
String s) → void -
isFocused(
) → bool - Returns whether the textarea is focused.
-
lineAt(
int i) → String - Returns the text of the line at the given index.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
setCharLimit(
int n) → void - Sets the character limit.
-
setCursor(
int row, int col) → void - Sets the cursor position.
-
setHeight(
int h) → void - Sets the height of the textarea.
-
setPlaceholder(
String s) → void - Sets the placeholder text.
-
setPromptFunc(
int promptWidth, PromptFunc fn) → void - Sets the prompt function.
-
setValue(
String v) → void - Sets the value of the textarea (parity with bubbles).
-
setWidth(
int w) → void - Sets the width of the textarea.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Msg msg) → (TextAreaModel, Cmd?) -
Updates the component state in response to a message.
override
-
view(
) → Object -
Renders the current model state for display.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited