mirror of
https://github.com/foss42/apidash.git
synced 2025-12-12 16:17:34 +08:00
readOnly implementation in widget as well as history page
This commit is contained in:
@@ -145,6 +145,7 @@ class HisRequestBody extends ConsumerWidget {
|
|||||||
fieldKey:
|
fieldKey:
|
||||||
"${selectedHistoryModel?.historyId}-json-body-viewer",
|
"${selectedHistoryModel?.historyId}-json-body-viewer",
|
||||||
initialValue: requestModel?.body,
|
initialValue: requestModel?.body,
|
||||||
|
readOnly: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_ => Padding(
|
_ => Padding(
|
||||||
|
|||||||
@@ -14,11 +14,13 @@ class JsonTextFieldEditor extends StatefulWidget {
|
|||||||
required this.fieldKey,
|
required this.fieldKey,
|
||||||
this.onChanged,
|
this.onChanged,
|
||||||
this.initialValue,
|
this.initialValue,
|
||||||
|
this.readOnly = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String fieldKey;
|
final String fieldKey;
|
||||||
final Function(String)? onChanged;
|
final Function(String)? onChanged;
|
||||||
final String? initialValue;
|
final String? initialValue;
|
||||||
|
final bool readOnly;
|
||||||
@override
|
@override
|
||||||
State<JsonTextFieldEditor> createState() => _JsonTextFieldEditorState();
|
State<JsonTextFieldEditor> createState() => _JsonTextFieldEditorState();
|
||||||
}
|
}
|
||||||
@@ -101,6 +103,7 @@ class _JsonTextFieldEditorState extends State<JsonTextFieldEditor> {
|
|||||||
borderRadius: kBorderRadius8,
|
borderRadius: kBorderRadius8,
|
||||||
),
|
),
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
|
readOnly: widget.readOnly,
|
||||||
isFormatting: true,
|
isFormatting: true,
|
||||||
key: Key(widget.fieldKey),
|
key: Key(widget.fieldKey),
|
||||||
controller: controller,
|
controller: controller,
|
||||||
|
|||||||
Reference in New Issue
Block a user