パッケージ、リポジトリ、アプリカテゴリを検索

colored_json のカバー
パッケージ詳細v1.1.2

colored_json

JSON文字列をカスタマイズ可能なFlutterウィジェットに変換するパッケージです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
3510
いいね数
27
Pub ポイント
160

パッケージをインストール

flutter pub add colored_json

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

JSON文字列を視覚的に強化され、カスタマイズ可能なウィジェットに変換するFlutterパッケージです。構造化されたJSONデータをアプリ内で読みやすく、美しく表示できるようにします。キー、値、括弧などの異なるJSON要素に対して色のカスタマイズが可能で、デバッグやデータ表示時の可読性を向上させます。開発ツール、ダッシュボード、またはフォーマットされたJSON出力が必要な任意のUIに最適です。

用途

  • JSON 応答のデバッグ
  • アプリケーションでAPIデータを表示する
  • 開発者ツールインターフェースの向上
  • 構成ファイルの可視化
  • リアルタイムデータの検査
  • 教育アプリのコンテンツ表示

主な機能

  • JSON の構文強調
  • カスタマイズ可能な色とスタイル
  • Flutter ウィジェットとの簡単な統合
  • すべての主要プラットフォームをサポートしています
  • 軽量で高速レンダリング
  • カスタマイズ可能なインデントとスペース

適している対象

  • Flutter開発者
  • デバッグツール
  • API テストインターフェース
  • 学習アプリ
  • 構造化データと連携するUIデザイナー

注意事項

  • 非常に大きなJSONではパフォーマンスに影響する可能性があります
  • 静的JSON表示に限定
  • 手動での文字列入力または解析が必要です
  • 動的JSON編集には適していません
  • カラーテーマは明示的な設定が必要です
  • 非本番デバッグビューで最適に使用されます

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Colored JSON

Convert JSON string into customizable widget.

Getting Started

ColoredJson is a stateless widget that produces a structured view of JSON string provided. It can be used like any other flutter widget. It's fully customizable where you can set different colors to different datatypes including colon, comma and brackets. Set indent length. Use text style of your choice. You can also change the background color.

Defaut View Customised View 1 Customised View 2
Default View Customized View 1 Customized View 2

Usage

  • Pass a JSON string to the data parameter of ColoredJson Widget
Simple Usage
const String responseBody = '''
{
  'id' : 1,
  'name' : 'Colored Json',
  'isFlutterAwesome' : true,
}
''';

ColoredJson(
 data: responseBody,
)

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

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,
  ),
 )
Parameter Info
data (required) A JSON string to be formatted
keyColor Color of Json Key
intColor Color of integer type value
doubleColor Color of decimal type value
stringColor Color of string type value
boolColor Color of boolean type value
nullColor Color of null type value
curlyBracketColor Color of curly brackets {}
squareBracketColor Color of square brackets []
commaColor Color of comma ( , )
colonColor Color of colon ( : )
backgroundColor Background color of widget
textStyle Textstyle of texts in the widget
indentLength Indent length

Upcoming Tasks

  • Code shrink feature
  • Add Inner Spacing parameter
  • Add tests

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。