convert 2.1.1

  • Readme
  • Changelog
  • Installing
  • 85

Conversion utilities package #

This package contains encoders and decoders for converting between different data representations. It's the external counterpart of the dart:convert core library, and contains less-central APIs and APIs that need more flexible versioning.

2.1.1 #

  • Fixed a DDC compilation regression for consumers using the Dart 1.x SDK that was introduced in 2.1.0.

2.1.0 #

  • Added an IdentityCodec<T> which implements Codec<T,T> for use as default value for in functions accepting an optional Codec as parameter.

2.0.2 #

  • Set max SDK version to <3.0.0, and adjust other dependencies.

2.0.1 #

  • PercentEncoder no longer encodes digits. This follows the specified behavior.

2.0.0 #

Note: No new APIs have been added in 2.0.0. Packages that would use 2.0.0 as a lower bound should use 1.0.0 instead—for example, convert: ">=1.0.0 <3.0.0".

  • HexDecoder, HexEncoder, PercentDecoder, and PercentEncoder no longer extend ChunkedConverter.

1.1.1 #

  • Fix all strong-mode warnings.

1.1.0 #

  • Add AccumulatorSink, ByteAccumulatorSink, and StringAccumulatorSink classes for providing synchronous access to the output of chunked converters.

1.0.1 #

  • Small improvement in percent decoder efficiency.

1.0.0 #

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  convert: ^2.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:convert/convert.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
99
Health:
Code health derived from static analysis. [more]
80
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
56
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

We analyzed this package on Mar 31, 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

Fix lib/src/hex/decoder.dart. (-5.36 points)

Analysis of lib/src/hex/decoder.dart reported 11 hints, including:

line 13 col 20: Avoid const keyword.

line 25 col 13: Unnecessary new keyword.

line 29 col 17: Unnecessary new keyword.

line 35 col 7: Unnecessary new keyword.

line 64 col 15: Unnecessary new keyword.

Fix lib/src/percent/decoder.dart. (-4.89 points)

Analysis of lib/src/percent/decoder.dart reported 10 hints, including:

line 15 col 24: Avoid const keyword.

line 32 col 18: Unnecessary new keyword.

line 36 col 13: Unnecessary new keyword.

line 44 col 7: Unnecessary new keyword.

line 71 col 18: Unnecessary new keyword.

Fix lib/src/hex/encoder.dart. (-2.48 points)

Analysis of lib/src/hex/encoder.dart reported 5 hints:

line 13 col 20: Avoid const keyword.

line 25 col 7: Unnecessary new keyword.

line 54 col 16: Unnecessary new keyword.

line 72 col 44: Unnecessary new keyword.

line 78 col 11: Unnecessary new keyword.

Fix additional 8 files with analysis or formatting issues. (-8.97 points)

Additional issues in the following files:

  • lib/src/byte_accumulator_sink.dart (4 hints)
  • lib/src/percent/encoder.dart (4 hints)
  • lib/src/string_accumulator_sink.dart (3 hints)
  • lib/src/accumulator_sink.dart (2 hints)
  • lib/src/identity_codec.dart (2 hints)
  • lib/src/hex.dart (1 hint)
  • lib/src/percent.dart (1 hint)
  • lib/src/utils.dart (1 hint)

Maintenance suggestions

Package is getting outdated. (-27.95 points)

The package was last published 66 weeks ago.

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 convert.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

The package description is too short. (-6 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.17.0 <3.0.0
charcode ^1.1.0 1.1.3
typed_data ^1.1.0 1.1.6
Dev dependencies
test >=0.12.0 <2.0.0