json_serializable_immutable_collections 0.3.0

  • Readme
  • Changelog
  • Installing
  • 67

json_serializable_immutable_collections #

Pub Package

(De-)Serialize more collections using json_serializable.

Unofficial package, meant to extend the functionality of json_serializable.

Features: #

Behaves like json_serializable, but supports more collections.

Currently supported:

  • All types supported by json_serializable
  • BuiltList
  • BuiltSet
  • BuiltMap
  • KtList
  • KtSet
  • KtMap

Do you want to use even more types? Feel free to open an issue. PRs also welcome.

How to use #

Add to your dev_dependencies:

    json_serializable_immutable_collections: <current_version>

Add to your build.yaml (create the file if necessary, this is necessary to avoid conflicts between json_serializable and this library):

    targets:
      $default:
        builders:
          json_serializable_immutable_collections:
            # configure your options here, same as json_serializable
            options:
              explicit_to_json: true
          json_serializable:json_serializable:
            generate_for:
              # exclude everything to avoid conflicts, this library uses a custom builder
              include:
              exclude:
                - test/**
                - lib/**

0.3.0 #

  • Depend on json_serializable ^3.3.0 to use types which are now exported on this version
  • Update dependencies

0.2.0 #

  • Remove unnecessary null check when generating code for BuiltList

0.1.1 #

  • Loosen up dependency version ranges

0.1.0 #

  • Badge

0.0.4 #

  • Pana fixes

0.0.3 #

  • Documentation fixes

0.0.2 #

  • Documentation fixes

0.0.1 #

  • Initial Release

Use this package as a library

1. Depend on it

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


dependencies:
  json_serializable_immutable_collections: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support 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_serializable_immutable_collections/builder.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
38
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Apr 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Format lib/src/built_collection_type_helpers.dart.

Run dartfmt to format lib/src/built_collection_type_helpers.dart.

Format lib/src/kt_dart_type_helpers.dart.dart.

Run dartfmt to format lib/src/kt_dart_type_helpers.dart.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_serializable_immutable_collections.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
analyzer ^0.39.0 0.39.6
build ^1.2.2 1.2.2
build_runner ^1.8.0 1.8.1
built_collection >=4.0.0 <5.0.0 4.3.2
json_annotation ^3.0.1 3.0.1
json_serializable >=3.3.0 <4.0.0 3.3.0
kt_dart >=0.6.0 <=1.0.0 0.7.0+1
source_gen >=0.9.4 <=1.0.0 0.9.5
Transitive dependencies
_fe_analyzer_shared 2.1.0
args 1.6.0
async 2.4.1
build_config 0.4.2
build_daemon 2.1.4
build_resolvers 1.3.4
build_runner_core 5.0.0
built_value 7.0.9
charcode 1.1.3
checked_yaml 1.0.2
code_builder 3.2.1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.4
fixnum 0.10.11
glob 1.2.0
graphs 0.2.0
html 0.14.0+3
http_multi_server 2.2.0
http_parser 3.1.4
io 0.3.4
js 0.6.1+1
logging 0.11.4
matcher 0.12.6
meta 1.1.8
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.9.3
path 1.6.4
pedantic 1.9.0
pool 1.4.0
pub_semver 1.4.4
pubspec_parse 0.1.5
quiver 2.1.3
shelf 0.7.5
shelf_web_socket 0.2.3
source_span 1.7.0
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 1.2.0
string_scanner 1.0.5
term_glyph 1.1.0
timing 0.1.1+2
typed_data 1.1.6
watcher 0.9.7+14
web_socket_channel 1.1.0
yaml 2.2.0
Dev dependencies
test ^1.14.2