diff --git a/lib/screens/history/history_widgets/his_request_pane.dart b/lib/screens/history/history_widgets/his_request_pane.dart index f9d38300..a64b96f8 100644 --- a/lib/screens/history/history_widgets/his_request_pane.dart +++ b/lib/screens/history/history_widgets/his_request_pane.dart @@ -145,6 +145,7 @@ class HisRequestBody extends ConsumerWidget { fieldKey: "${selectedHistoryModel?.historyId}-json-body-viewer", initialValue: requestModel?.body, + readOnly: true, ), ), _ => Padding( diff --git a/lib/widgets/editor_json.dart b/lib/widgets/editor_json.dart index 3d13e439..b7e24dbe 100644 --- a/lib/widgets/editor_json.dart +++ b/lib/widgets/editor_json.dart @@ -14,11 +14,13 @@ class JsonTextFieldEditor extends StatefulWidget { required this.fieldKey, this.onChanged, this.initialValue, + this.readOnly = false, }); final String fieldKey; final Function(String)? onChanged; final String? initialValue; + final bool readOnly; @override State createState() => _JsonTextFieldEditorState(); } @@ -101,6 +103,7 @@ class _JsonTextFieldEditorState extends State { borderRadius: kBorderRadius8, ), showErrorMessage: true, + readOnly: widget.readOnly, isFormatting: true, key: Key(widget.fieldKey), controller: controller,