flutter_json
0.2.0, released 3 months ago by sevdev.at
Renders valid JSON as an interactive hierarchical tree structure with lazy loading.
What it does
Flutter JSON allows you to beautifully render any valid JSON as an interactive hierarchical tree structure in your app. It supports lazy rendering of children for improved performance and offers extensive customization options for styling and appearance.
AI-written summary of version 0.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to inspect or display JSON data hierarchically within your Flutter app UI.
- You are dealing with large JSON structures up to 25 MB and require lazy rendering for performance.
Skip it when
- You do not have a bounded height available for the widget.
- You need custom non-fixed-width horizontal scrolling constraints.
Strengths
- Supports rendering any valid JSON data structures.
- Lazily renders tree structures for improved performance with large JSON payloads.
- Offers extensive customization for styling, appearance, icons, and hidden keys.
Weaknesses
- Requires a bounded height due to lazy loading limitations.
- Forces fixed-width constraints for nodes to allow horizontal scrolling.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
import 'package:flutter_json/flutter_json.dart';
const String jsonString = '{ "foo": "bar", "baz": [1, 2, 3] }';
class MyPage extends StatelessWidget {
const MyPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("JSON Example"),
),
body: JsonWidget(
json: json.decode(jsonString),
initialExpandDepth: 2,
hiddenKeys: const ["foo"],
),
);
}
}Alternatives
Packages that do the same job and could replace flutter_json.
- flutter_gantt
Interactive Gantt chart widget for Flutter
75Compare - flutter_earth_globe
An interactive and fully customizable 3D Globe widget written in pure Dart.
80Compare - flutter_fancy_tree_view2
Widgets and slivers for rendering hierarchical tree structures and handling drag-and-drop.
77Compare - colored_json
Widget that pretty‑prints a JSON string with customizable colors.
50Compare
Works with
Packages commonly used together with flutter_json: ones it builds on, ones built on it, and its own family.