mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: format code
This commit is contained in:
parent
3e256be0b9
commit
215587a507
@ -106,18 +106,19 @@ class TransactionBuilder {
|
|||||||
|
|
||||||
insertText(TextNode node, int index, String content,
|
insertText(TextNode node, int index, String content,
|
||||||
[Attributes? attributes]) {
|
[Attributes? attributes]) {
|
||||||
|
var newAttributes = attributes;
|
||||||
|
if (index != 0 && attributes == null) {
|
||||||
|
newAttributes = node.delta
|
||||||
|
.slice(max(index - 1, 0), index)
|
||||||
|
.operations
|
||||||
|
.first
|
||||||
|
.attributes;
|
||||||
|
}
|
||||||
textEdit(
|
textEdit(
|
||||||
node,
|
node,
|
||||||
() => Delta().retain(index).insert(
|
() => Delta().retain(index).insert(
|
||||||
content,
|
content,
|
||||||
attributes ??
|
newAttributes,
|
||||||
(index == 0
|
|
||||||
? null
|
|
||||||
: node.delta
|
|
||||||
.slice(max(index - 1, 0), index)
|
|
||||||
.operations
|
|
||||||
.first
|
|
||||||
.attributes),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
afterSelection = Selection.collapsed(
|
afterSelection = Selection.collapsed(
|
||||||
|
Loading…
Reference in New Issue
Block a user