better json editor

This commit is contained in:
hiddify-com
2024-07-30 18:47:49 +02:00
parent ce01af1cd8
commit f3e73aee39
2 changed files with 5 additions and 3 deletions

View File

@@ -426,6 +426,7 @@ class _JsonEditorState extends State<JsonEditor> {
), ),
child: Row( child: Row(
children: [ children: [
const Text('Config Editor: '),
if (!widget.hideEditorsMenuButton) if (!widget.hideEditorsMenuButton)
PopupMenuButton<Editors>( PopupMenuButton<Editors>(
initialValue: _editor, initialValue: _editor,
@@ -554,8 +555,9 @@ class _JsonEditorState extends State<JsonEditor> {
child: TextFormField( child: TextFormField(
controller: _controller, controller: _controller,
onChanged: parseData, onChanged: parseData,
maxLines: 10, maxLines: null,
// expands: true, minLines: null,
expands: true,
textAlignVertical: TextAlignVertical.top, textAlignVertical: TextAlignVertical.top,
decoration: const InputDecoration( decoration: const InputDecoration(
border: InputBorder.none, border: InputBorder.none,

View File

@@ -274,7 +274,7 @@ class ProfileDetailsPage extends HookConsumerWidget with PresLogger {
], ],
if (state.isEditing) ...[ if (state.isEditing) ...[
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.8, height: MediaQuery.of(context).size.height * 0.9,
child: JsonEditor( child: JsonEditor(
expandedObjects: const ["outbounds"], expandedObjects: const ["outbounds"],
onChanged: (value) { onChanged: (value) {