搜索插件、代码仓与 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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。