v1.0.2
flutter_json_widget
一个用于 Flutter 的 JSON 查看器小部件。以可扩展列表的形式显示 JSON 数据,使手机上的数据易于阅读。
30喜欢 23近 30 天下载40Pub 分数
平台暂无数据
一个用于显示 JSON 对象的组件
{"sdk":"flutter"}{"sdk":"flutter"}以下为英文项目原文快照,最新内容请访问 GitHub。
A Json viewer widget for flutter.
The /example/ folder in the GitHub repo
contains a full Flutter app with demo examples.
Add this to your package's pubspec.yaml file:
dependencies:
flutter_json_widget: ^1.0.3
You can install packages from the command line:
with Flutter:
$ flutter pub get
Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:flutter_json_widget/flutter_json_widget.dart';
@override
Widget build(BuildContext context) {
var testString = '''{
"I": "How are you?",
"You": "Excellent!"}
''';
Map<String, dynamic> jsonObj = jsonDecode(testString);
return SafeArea(
child: SingleChildScrollView(
child: JsonViewerWidget(jsonObj)
),
);
}
Demo