mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-26 21:00:17 +08:00
Add Note.apply
Avoid calling each setter as each results in the entire tree being rebuilt.
This commit is contained in:
@ -154,7 +154,7 @@ class OrgEditorState extends State<OrgEditor>
|
||||
Future<void> addImage(String filePath) async {
|
||||
var note = getNote();
|
||||
var image = await core.Image.copyIntoFs(note.parent, filePath);
|
||||
note.body += image.toMarkup(note.fileFormat);
|
||||
note.apply(body: note.body + image.toMarkup(note.fileFormat));
|
||||
|
||||
setState(() {
|
||||
_textController.text = note.body;
|
||||
|
Reference in New Issue
Block a user