json_utilities 0.1.1

  • README.md
  • Installing
  • Versions
  • 80

json_utilities #

Dart/Flutter package to enhance the experience of working with json based models. Can be used in conjunction with json_serializable.

See Examples for more details.

Usage #

To use this plugin, add json_utilites as a dependency in your pubspec.yaml file

Examples #

Basic Example #

import 'package:json_utilities/json_utilities.dart';

var json = <String, dynamic>{
  'root': 'value',
  'root2': <String, dynamic>{'leaf': 'fruit'}

JSONUtils().get(json,'root.leaf', 'defaultValue') // returns String defaultValue
JSONUtils().get(json,'root', 'defaultValue') // returns String value
JSONUtils().get(json,'root2', 'defaultValue') // <String, dynamic>{'leaf': 'fruit'}
JSONUtils().get(json,'root.leaf.deeperLeaf', 'defaultValue') / returns String defaultValue

json_serializable Example #

// model/Condition.dart
import 'package:json_annotation/json_annotation.dart';

part 'Condition.g.dart';

class Condition {

  String text;
  String language;


   * Json to Location object
  factory Condition.fromJson(Map<String, dynamic> json) =>

   * Location object to json
  Map<String, dynamic> toJson() => _$ConditionToJson(this);

import 'package:json_utilities/json_utilities.dart';
import 'model/Condition.dart';

    Condition condition;


       return JSONUtils().get(condition.toJson(),'language', 'none')+');


  • Added CHANGELOG.md and README.md with basic examples
  • Added MIT License


  • Initial release

Use this package as a library

1. Depend on it

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

  json_utilities: ^0.1.1

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:json_utilities/json_utilities.dart';
Version Uploaded Documentation Archive
0.1.3 Jan 7, 2019 Go to the documentation of json_utilities 0.1.3 Download json_utilities 0.1.3 archive
0.1.2 Dec 27, 2018 Go to the documentation of json_utilities 0.1.2 Download json_utilities 0.1.2 archive
0.1.1 Dec 21, 2018 Go to the documentation of json_utilities 0.1.1 Download json_utilities 0.1.1 archive
0.1.0 Dec 20, 2018 Go to the documentation of json_utilities 0.1.0 Download json_utilities 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15
  • Flutter: 1.5.8


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/json_utilities.dart.

Run flutter format to format lib/json_utilities.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and json_utilities.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies