v0.0.8json_editor
一個 Flutter 上的 JSON 編輯器。
22喜歡 1500近 30 天下載110Pub 分數
AndroidiOSmacOSWindowsLinux
一個基於 Flutter 的 JSON 編輯器
{"sdk":"flutter"}^1.1.0{"sdk":"flutter"}^1.0.0以下為英文專案原文快照,最新內容請造訪 GitHub。
img
JsonElement ;dependencies:
json_editor: ^0.0.8
https://tva1.sinaimg.cn/large/008i3skNgy1gysber4x5tj318f0u0ta7.jpg
https://tva1.sinaimg.cn/large/008i3skNgy1gyscug2rpbg30qo0f0nh5.gif
import 'package:json_editor/json_editor.dart';
JsonEditor.string(
jsonString: '''
{
// This is a comment
"name": "young chan",
"number": 100,
"boo": true,
"user": {"age": 20, "tall": 1.8},
"cities": ["beijing", "shanghai", "shenzhen"]
}
''',
onValueChanged: (value) {
print(value);
},
)
import 'package:json_editor/json_editor.dart';
JsonEditor.object(
object: const {
"name": "young",
"number": 100,
"boo": true,
"user": {"age": 20, "tall": 1.8},
"cities": ["beijing", "shanghai", "shenzhen"]
},
onValueChanged: (value) {
print(value);
},
)
JsonElement is a data model witch contains key, value and comment.
import 'package:json_editor/json_editor.dart';
JsonEditor.element(
element: JsonElement(),
onValueChanged: (value) {
print(value);
},
)
If you want to custom the json theme. You can use JsonEditorTheme widget.
JsonEditorTheme(
themeData: JsonEditorThemeData.defaultTheme(),
child: JsonEditor.object(
object: const {
"name": "young",
"number": 100,
"boo": true,
"user": {"age": 20, "tall": 1.8},
"cities": ["beijing", "shanghai", "shenzhen"]
},
onValueChanged: (value) {
print(value);
},
)
)
See LICENSE