json_editor_flutter는 앱 내에서 JSON 객체를 상호작용적으로 편집할 수 있도록 해주는 사용자 친화적인 Flutter 패키지입니다. JSON 키와 값을 생성하고 수정하며 삭제할 수 있는 깔끔하고 직관적인 인터페이스를 제공합니다. 실시간 검증과 중첩된 객체 조작을 지원하여 UI에서 직접 JSON 데이터를 다뤄야 하는 개발자에게 이상적입니다. 모든 주요 플랫폼을 지원하며, 동적 JSON 입력이 필요한 Flutter 애플리케이션에 원활하게 통합됩니다.
사용 사례
구성 파일 편집
API 응답 디버깅
폼 빌더 만들기
JSON 스키마 편집기 만들기
프로토타이핑 데이터 구조
주요 기능
인터랙티브한 JSON 트리 뷰
실시간 검증
중첩된 객체 지원
크로스 플랫폼 호환성
Flutter 폼과의 간편한 통합
적합한 대상
관리 패널을 구축하는 개발자
JSON 입력이 필요한 앱 제작자
JSON 학습을 위한 교육 도구
API 테스트 및 디버깅 도구
고려 사항
복잡한 레이아웃을 위해 사용자 정의 스타일링이 필요할 수 있습니다
기본 JSON 작업에 한정
매우 큰 JSON 파일에 최적화되지 않음
내장된 내보내기/가져오기 기능 없음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
JsonEditor class
Edit your JSON object with this package. Create, edit and format objects using this user friendly widget.
JSON can be edited in two ways, Tree editor or text editor. You can disable either of them.
When UI editor is active, you can disable adding/deleting keys by using enableMoreOptions. Editing keys and values can also be disabled by using enableKeyEdit and enableValueEdit.
When text editor is active, it will simply ignore enableMoreOptions, enableKeyEdit and enableValueEdit.
duration is the debounce time for onChanged function. Defaults to 500 milliseconds.
editors is the supported list of editors. First element will be used as default editor. Defaults to [Editors.tree, Editors.text].
[expandedObjects] refers to the objects that will be expanded by default. Index can be provided when the data is a List.
data = {
"hobbies": ["Reading books", "Playing Cricket"],
"education": [
{"name": "Bachelor of Engineering", "marks": 75},
{"name": "Master of Engineering", "marks": 72},
],
}
For the given data
To expand education pass => ["education"]
To expand hobbies and education pass => ["hobbies", "education"]
To expand the first element (index 0) of education list, this means we need to expand education too. In this case you need not to pass "education" separately. Just pass a list of all nested objects => [["education", 0]]