json_async 0.1.1

  • Readme
  • Changelog
  • Installing
  • 74

json_async #

Runs JSON encoding/decoding in a separate, long-running, isolate.

This is helpful when working with JSON frequently and the spawning/destruction or a new isolate (e.g. when used in via compute) creates too much overhead.

Example #

final String str = await jsonDecodeAsync('"ABC"');

final Map<String, int> map = await jsonDecodeAsyncMap<int>('{"0":1}');

final List<String> list = await jsonDecodeAsyncList<String>('["A","B"]');

All 3 calls will be run in a shared background isolate.

Errors will be forwarded to the caller.

0.1.1 #

  • Adds license.

0.1.0 #

  • Error handling & recovery for invalid JSON decoding/encoding.

0.0.3 #

  • Adds decoding tests.
  • Adds new helper methods to decode into list/map directly.
  • Updates README to get started quickly.

0.0.2 - pub update #

  • No functional changes, only a update on pub.

0.0.1 - Initial Release #

  • Basic functionality

Use this package as a library

1. Depend on it

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

  json_async: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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_async/json_async.dart';
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 Jul 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web


  • package:json_async/json_async.dart that imports:
  • dart:isolate

Package not compatible with runtime js


  • package:json_async/json_async.dart that imports:
  • dart:isolate

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_async.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.3.0 <3.0.0
semaphore ^0.1.1 0.1.4
Dev dependencies
test ^1.6.1