Dart Convert

| Page Views: 77

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.

About Me.

After completing his Software Engineering bachelors program, Oclemy(Clement Ochieng) these days is a man of two lives. At day he works for a startup in Nairobi, Kenya. At night he works tirelessly on building ProgrammingWizards TV, a tv channel for student coders and this website to help share the source code. In between he practices Meditation and Self actualization to help him keep balance. He also likes going for long solo walks to connect more with nature.


What do You Think

Previous Post Next Post