Dart Convert

| Page Views: 22

Dart Convert Tutorial and Examples.

The dart's Convert librray contains encoders and decoders for converting between different data representations, including JSON and UTF-8. Furthermore it provides support for implementing converters in a way which makes them easy to chain and to use with streams.


You use it by first making sure to import it into your project:

import 'dart:convert';

Common Types

Here are the most common type of converters:

  1. JsonCodec- named json.It is a simple text format for representing structured objects and collections.The JSON encoder/decoder transforms between strings and object structures, such as lists and maps, using the JSON format.

  2. Utf8Codec - named utf8. UTF-8 is a common variable-width encoding that can represent every character in the Unicode character set. The UTF-8 encoder/decoder transforms between Strings and bytes.

In most cases we use the Converters with streams. This is because they transform the data that comes through the stream as it becomes available.

How do You Feel after reading this?

According to scientists, we humans have 8 primary innate emotions: joy, acceptance, fear, surprise, sadness, disgust, anger, and anticipation. Feel free to tell us how you feel about this article using these emotes or via the comment section. This feedback helps us gauge our progress.

Help me Grow.

I set myself some growth ambitions I desire to achieve by this year's end regarding this website and my youtube channel. Am halfway. Help me reach them by:


What do You Think

Previous Post Next Post