Skip to content
pubscout

convert

3.1.2, released 2 years ago by dart.dev

Encoders and decoders for converting between different data representations.

WASM-readyQuiet but busy
$ flutter pub add convert
Source repository

What it does

Provides additional Sink, Codec, Decoder, and Encoder types that complement the dart:convert SDK library. It includes utilities for handling less-central conversion APIs and flexible versioning.

AI-written summary of version 3.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need additional codecs or converters beyond what dart:convert offers
  • You are working with data representations like hex encoding or percent encoding

Skip it when

  • Core dart:convert features are entirely sufficient for your data representation needs

Strengths

  • Acts as an external counterpart to dart:convert for flexible versioning
  • Provides useful utilities like AccumulatorSink and CodePage

Weaknesses

  • Limited scope restricted to data conversions

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:convert/convert.dart';

void main() {
  var encoded = hex.encode([0x01, 0x02, 0x03]);
  print(encoded); // 010203
}

Alternatives

Packages that do the same job and could replace convert.

  • gtk

    GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.

  • flutter_flavorizr

    A utility to easily create and configure application flavors in Flutter.

  • mime

    Utilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.

  • conduit_codable

    A library for encoding and decoding dynamic structured data like JSON and YAML into Dart objects.

Works with

Packages commonly used together with convert: ones it builds on, ones built on it, and its own family.