搜尋套件、儲存庫與 APP 分類

flutter_json_view 封面
套件詳情v1.1.5

flutter_json_view

使用自訂選項在 Flutter 小部件中顯示 JSON 模型。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.7萬
喜歡數
145
Pub 分數
160

安裝套件

flutter pub add flutter_json_view

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,可將 JSON 數據以可自訂、易讀的元件格式顯示。它讓開發者能直接在其應用程式 UI 中視覺化 JSON 模型,支援樣式設定、展開控制與巢狀結構呈現。非常適合用於除錯、資料檢視或向使用者展示結構化資料。此套件支援所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 除錯 JSON 回應
  • 顯示 API 數據
  • 檢查設定檔
  • 展示資料結構的教育類應用程式
  • 建構開發者工具

主要特色

  • 可自訂主題與顏色
  • 可展開/收合的 JSON 節點
  • 支援所有 Flutter 平台
  • 與現有組件的輕鬆整合
  • 適用於不同螢幕尺寸的響應式版面

適合對象

  • 開發除錯工具的開發者
  • 需要JSON可視化的應用
  • 前端團隊與API協作
  • 教育或教程應用

使用建議

  • 可能影響非常大的 JSON 檔案的效能
  • 超出展開/收起之外的互動功能有限
  • 未經過客製化優化,無法用於生產資料顯示

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Displaying json models in a Flutter widget

😎 Cool solution for viewing models in debug working
Show some ❤️ and star the repo to support the project!


Pub License: MIT Repository views Pub

Pub likes Pub popularity Pub points


Image Image Image

Getting Started

Add dependency
dependencies:
  flutter_json_view: ^1.1.5
Add import package
import 'package:flutter_json_view/flutter_json_view.dart';
Easy to use

Add one of the constructors in your code

String constructor
JsonView.string('{"key":"value"}'),
Asset file constructor
JsonView.asset('assets/data.json'),
Map constructor
JsonView.map({"key":"value"}),

Customization

🎨 The package was created in order to be able to customize your json view

drawing
JsonView.string(
    '{"key":"value"}',
    theme: JsonViewTheme(
      keyStyle: TextStyle(
        color: Colors.black54,
        fontSize: 16,
        fontWeight: FontWeight.w600,
      ),
      doubleStyle: TextStyle(
        color: Colors.green,
        fontSize: 16,
      ),
      intStyle: TextStyle(
        color: Colors.green,
        fontSize: 16,
      ),
      stringStyle: TextStyle(
        color: Colors.green,
        fontSize: 16,
      ),
      boolStyle: TextStyle(
        color: Colors.green,
        fontSize: 16,
      ),
      closeIcon: Icon(
        Icons.close,
        color: Colors.green,
        size: 20,
      ),
      openIcon: Icon(
        Icons.add,
        color: Colors.green,
        size: 20,
      ),
      separator: Padding(
        padding: EdgeInsets.symmetric(horizontal: 8.0),
        child: Icon(
          Icons.arrow_right_alt_outlined,
          size: 20,
          color: Colors.green,
        ),
      ),
    ),
  ),

More examples you can see here


Thanks to all contributors of this package


For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。