colored_json 1.1.2 copy "colored_json: ^1.1.2" to clipboard
colored_json: ^1.1.2 copied to clipboard

A package that converts JSON string into a customizable flutter widget.

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:colored_json/colored_json.dart';

void main() {
  runApp(const MyApp());
}

final dartMap = {
  "id": 24,
  "name": "Manthan Khandale",
  "score": 7.6,
  "socials": null,
  "hobbies": [
    "Music",
    "Filmmaking",
  ],
  "isFlutterCool": true,
};

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(
            'Colored Json Example',
          ),
        ),
        body: Column(
          children: [
            ColoredJson(
              data: jsonEncode(dartMap),
              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,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
20
likes
140
pub points
85%
popularity
screenshot

Publisher

verified publishermanthankhandale.com

A package that converts JSON string into a customizable flutter widget.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on colored_json