September 2019
Beginner
512 pages
12h 52m
English
You can use the [] and {} syntaxes to initialize variables such as lists and maps, respectively. These are some examples of literals provided by the Dart language for creating objects of the provided built-in types:
|
Type |
Literal example |
|
int |
10, 1, -1, 5, and 0 |
|
double |
10.1, 1.2, 3.123, and -1.2 |
|
bool |
true and false |
|
String |
"Dart", 'Dash', and """multiline String""" |
|
List |
[1,2,3] and ["one", "two", "three"] |
|
Map |
{"key1": "val1", "b": 2}
|
Read now
Unlock full access