👔 Article wont show expand attachment list

This commit is contained in:
2024-10-19 16:55:14 +08:00
parent ac1b3fe15c
commit 0d807b8708
7 changed files with 125 additions and 27 deletions

View File

@ -125,6 +125,21 @@ class PostEditorController extends GetxController {
onRemove: (String value) {
attachments.remove(value);
},
onInsert: (String str) {
final text = contentController.text;
final selection = contentController.selection;
final newText = text.replaceRange(
selection.start,
selection.end,
str,
);
contentController.value = TextEditingValue(
text: newText,
selection: TextSelection.collapsed(
offset: selection.baseOffset + str.length,
),
);
},
),
);
}