-
Notifications
You must be signed in to change notification settings - Fork 0
/
Data_types.dart
63 lines (50 loc) · 1.78 KB
/
Data_types.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Here you can find all data types of Dart language with code
void main() {
//1:(Number) int & Double
int integer = 12; // here int is represent the integer value
double decimal = 98.96; // here double is represent decimal value
print("Integer value= $integer");
print("Decimal value= $decimal");
//2:(Strings) Represents a sequence of characters
String name = "Aamir";
String lastName = "siddique";
print("Name=$name\nLast Name=$lastName");
//3:(Booleans) Represents either true or false
bool firstValue = true;
bool secondValue = false;
print("First value=$firstValue\nSecond Value=$secondValue");
//4:(Lists)Represents an ordered collection of objects
List<String> Names = ["Aamir", "Zain", "Farhan", "Naveed", "Jahanzaib"];
List<int> rollNumber = [1, 2, 3, 4, 5];
print("List of Names=$Names");
print("List of RollNumbers=$rollNumber");
//5:(Maps)Represents a collection of key-value pairs
Map<String, int> Details = {
"Aamir": 1,
"Zain": 2,
"Farhan": 3,
"Naveed": 4,
"Jahanzaib": 5,
};
print("Detail of all Student's=$Details");
//6:(Sets)Represents an unordered collection of unique object
Set<String> mobileBrand = {
"Samsung",
"Apple",
"Oppo",
"Vivo",
"Nokia",
"Q-Moblie"
};
Set<int> Numbers = {1, 2, 3, 4, 5};
print("Mobile Brand Names: $mobileBrand");
print("Numbers=$Numbers");
//7:(Runes)Represents a sequence of Unicode characters
Runes heart = Runes('\u2665');
String heartSymbol = String.fromCharCodes(heart); //covert runes into Symbol
print("Heart:$heartSymbol");
//8:(Symbols)Represents a sequence of Unicode characters
Symbol symbol = #mysymbolname;
String symbolString = symbol.toString();
print("MY symbol:$symbolString");
}