diff --git a/lib/widgets/editor_json.dart b/lib/widgets/editor_json.dart index 69ce8cd9..5c00cb49 100644 --- a/lib/widgets/editor_json.dart +++ b/lib/widgets/editor_json.dart @@ -2,7 +2,7 @@ import 'dart:math' as math; import 'package:apidash_design_system/apidash_design_system.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:json_text_field/json_text_field.dart'; +import 'package:json_field_editor/json_field_editor.dart'; import 'package:apidash/consts.dart'; class JsonTextFieldEditor extends StatefulWidget { @@ -51,10 +51,12 @@ class _JsonTextFieldEditorState extends State { if (widget.initialValue != null) { controller.text = widget.initialValue!; } - Future.delayed(Duration(milliseconds: 50), () { - controller.formatJson(sortJson: false); - setState(() {}); - }); + // Below code fixes issue #782 but JSON formatting + // should be manual via beautify button + // Future.delayed(Duration(milliseconds: 50), () { + // controller.formatJson(sortJson: false); + // setState(() {}); + // }); editorFocusNode = FocusNode(debugLabel: "Editor Focus Node"); } @@ -90,7 +92,7 @@ class _JsonTextFieldEditorState extends State { insertTab(); }, }, - child: JsonTextField( + child: JsonField( key: Key(widget.fieldKey), commonTextStyle: kCodeStyle.copyWith( color: Theme.of(context).brightness == Brightness.dark