From f314dbf05297af893235d519894e56027e7e0f0b Mon Sep 17 00:00:00 2001 From: Thea Choem <29684683+theachoem@users.noreply.github.com> Date: Tue, 27 Sep 2022 20:13:29 +0700 Subject: [PATCH] fix wrong custom embed key (#962) --- lib/src/widgets/editor.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/widgets/editor.dart b/lib/src/widgets/editor.dart index 0ae0f69a..ef564491 100644 --- a/lib/src/widgets/editor.dart +++ b/lib/src/widgets/editor.dart @@ -485,14 +485,15 @@ class QuillEditorState extends State if (builders != null) { var _node = node; + final type = node.value.type; // Creates correct node for custom embed - if (node.value.type == BlockEmbed.customType) { + if (type == BlockEmbed.customType) { _node = Embed(CustomBlockEmbed.fromJsonString(node.value.data)); } for (final builder in builders) { - if (builder.key == _node.value.type) { + if (builder.key == type) { return builder.build(context, controller, _node, readOnly); } }