FLUTTER ECOSYSTEM

demdog/flutter_json_widget

JSON オブジェクトを表示するウィジェット

flutter_json_widget のプロジェクト画像
Stars
30
Forks
25
最終プッシュ(UTC)
2021/06/30
プロジェクト状態
公開中
demdog GitHub avatar
GITHUB User

demdog ↗

言語DartShellSwiftKotlinObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 2 件
  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

flutter_json_widget

A Json viewer widget for flutter.

Using the library

The /example/ folder in the GitHub repo contains a full Flutter app with demo examples.

Use this package as a library on Dart dev

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_json_widget: ^1.0.3
2. Install it

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.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_json_widget/flutter_json_widget.dart';
4. Show it
@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

Demo