From a90fff0c08f20e15546054c812889beb19dd355e Mon Sep 17 00:00:00 2001 From: Manas Hejmadi Date: Sun, 6 Apr 2025 22:44:42 +0530 Subject: [PATCH] Added Slight Delay to formatJson call to prevent '' error --- lib/widgets/editor_json.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/widgets/editor_json.dart b/lib/widgets/editor_json.dart index 3e4c24258..69ce8cd9a 100644 --- a/lib/widgets/editor_json.dart +++ b/lib/widgets/editor_json.dart @@ -51,7 +51,10 @@ class _JsonTextFieldEditorState extends State { if (widget.initialValue != null) { controller.text = widget.initialValue!; } - controller.formatJson(sortJson: false); + Future.delayed(Duration(milliseconds: 50), () { + controller.formatJson(sortJson: false); + setState(() {}); + }); editorFocusNode = FocusNode(debugLabel: "Editor Focus Node"); }