Skip to content
pubscout

colored_json

1.1.2, released 4 years ago by manthankhandale.com

Widget that pretty‑prints a JSON string with customizable colors.

WASM-ready
$ flutter pub add colored_json
Source repository

What it does

ColoredJson renders a JSON string as a structured, color‑coded widget. It allows developers to customize colors for keys, values, brackets, and other syntax elements.

AI-written summary of version 1.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • displaying JSON data for debugging or documentation
  • showing API responses in a readable format
  • creating visual examples of JSON structures

Skip it when

  • handling large or streaming JSON data
  • performance‑critical rendering where every frame matters

Strengths

  • highly customizable appearance
  • simple stateless API
  • no external dependencies

Weaknesses

  • no automated tests documented
  • limited to string input only
  • no support for dynamic data updates

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
ColoredJson(
  data: jsonEncode({
    "id": 24,
    "name": "Manthan Khandale",
    "score": 7.6,
    "hobbies": ["Music", "Filmmaking"],
    "isFlutterCool": true,
  }),
  indentLength: 5,
  keyColor: Colors.green,
  backgroundColor: Colors.black,
  boolColor: Colors.white,
  nullColor: Colors.redAccent,
  stringColor: Colors.cyan,
  curlyBracketColor: Colors.yellow,
  doubleColor: Colors.deepOrange,
  squareBracketColor: Colors.amber,
  commaColor: Colors.yellow,
  colonColor: Colors.purple,
  intColor: Colors.lime,
  textStyle: const TextStyle(fontSize: 20, letterSpacing: 2),
)

Alternatives

Packages that do the same job and could replace colored_json.