convert 3.0.0-nullsafety.0 copy "convert: ^3.0.0-nullsafety.0" to clipboard
convert: ^3.0.0-nullsafety.0 copied to clipboard

outdated

Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types.

example/example.dart

// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:convert';

import 'package:convert/convert.dart';

void main(List<String> args) {
  // Creates a Codec that converts a UTF-8 strings to/from percent encoding
  final fusedCodec = utf8.fuse(percent);

  final input = args.isNotEmpty ? args.first : 'ABC 123 @!(';
  print(input);
  final encodedMessage = fusedCodec.encode(input);
  print(encodedMessage);

  final decodedMessage = fusedCodec.decode(encodedMessage);
  assert(decodedMessage == input);
}
110
likes
0
pub points
99%
popularity

Publisher

verified publisherdart.dev

Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

typed_data

More

Packages that depend on convert