The data types that a programming language supports are one of its fundamental properties. In a programming language, these are the types of values that can be given and manipulated. Dart has a total of six different kinds of data types.
Dart Supports Following Built in Data Types:
1.Numbers
2. Booleans
3. Lists
4. Strings
5. Maps
6. Runes
1. Numbers
Dart number has two subtypes:
- Integar
Dart Integer is a non-fractional numeric value that lacks a point. It can have any value, from natural numbers to their inverses. The int keyword can be used to declare integers.
- Double
Dart Double is a 64-bit floating-point number or fractional decimal value. They can be declared by using the double keyword.
2. Booleans
The Boolean operator is used to store valid and false values. The “bool” keyword is used when declaring a Boolean data type. They are most commonly found in decision-making statements.
3. Lists
The Lists data type is used to represent a group of things. In other programming languages, it is comparable to the concept of an array.
4. Strings
Strings are a series of characters or a group of characters. It can be used to store any number of characters such as names, personal information, and other types of information. To define a string, use single and double quotations.
5. Maps
Dart Maps is a tool for representing a set of values in key-value pairs format. In Maps, each key corresponds to a single value. For mapping, both keys and values can be of any type.
6. Runes
The Runes type also represents strings, but unlike String, Runes are a sequence of UTF-16 characters. Since by default all quoted strings (both single and double) are of the String type, a special syntax is required to define the Runes variable. First comes the “new” operator, then the type name – Runes, followed by the argument passed to the constructor in parentheses. We can pass to the constructor either a set of UTF-16 encoded code units (new Runes(‘\u041F\u0440\u0438\u0432\u0435\u0442’)), or a regular set of characters (new Runes(‘Hello’)).