Search packages, repositories and app categories

json_editor cover
Package detailsv0.0.8

json_editor

A json editor on flutter.

AndroidiOSmacOSWindowsLinux
30-day downloads
2.1K
Likes
22
Pub points
110

Install package

flutter pub add json_editor

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides a customizable JSON editor for displaying and editing JSON data in Flutter applications. It supports syntax highlighting, collapsible nodes, and real-time validation, making it ideal for developers who need to work with JSON structures directly within their apps. The editor is designed to be intuitive and responsive across multiple platforms, including mobile and desktop. It integrates seamlessly with existing Flutter projects via a simple pub add command.

Use cases

  • Editing JSON configuration files
  • Debugging API responses
  • Interactive data input forms
  • Real-time JSON validation
  • Prototyping JSON-based workflows

Key features

  • Syntax highlighting
  • Collapsible JSON nodes
  • Real-time validation
  • Cross-platform support
  • Customizable UI theme

Suitable for

  • Developers building JSON-heavy apps
  • UI designers prototyping data structures
  • Tools requiring interactive JSON editing
  • Educational apps teaching JSON
  • Desktop and mobile app developers

Considerations

  • May require performance optimization for large JSON files
  • Limited advanced JSON schema features
  • No built-in export/import functionality
  • Depends on external GitHub repository
  • Not optimized for extremely nested or deep JSON structures

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

img

Features

  1. Support add comment;
  2. Support show errors for invalid json text;
  3. Pretty format json text;
  4. Output a custom json data model: JsonElement ;

Getting started

dependencies:
    json_editor: ^0.0.8

Screen Shot

Usage

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);
    },
)
Theme

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);
        },
    )
)

License

See LICENSE

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.