InsertNewlineInTaskAtCaretCommand class
An EditCommand that inserts a newline when the caret sits within a TaskNode.
This command adds the following behaviors beyond the usual:
-
When the caret is in the middle of a task, splits the task into two tasks.
-
When the caret is at the end of a task, inserts a new empty task, instead of an empty paragraph.
-
Inserting a newline into an empty task converts it into a paragraph instead of inserting a new task.
- Inheritance
-
- Object
- EditCommand
- BaseInsertNewlineAtCaretCommand
- InsertNewlineInTaskAtCaretCommand
Constructors
- InsertNewlineInTaskAtCaretCommand(String newNodeId)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- historyBehavior → HistoryBehavior
-
The desired "undo" behavior of this command.
no setterinherited
- newNodeId → String
-
The ID to use for a new node, if a new node is created.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
describe(
) → String -
inherited
-
doInsertNewline(
EditContext context, CommandExecutor executor, DocumentPosition caretPosition, NodePosition caretNodePosition) → void -
override
-
execute(
EditContext context, CommandExecutor executor) → void -
Executes this command and logs all changes with the
executor.inherited -
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