-
Notifications
You must be signed in to change notification settings - Fork 1
/
Basics.dart
75 lines (49 loc) · 1.79 KB
/
Basics.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
64
65
66
67
68
69
70
71
72
73
74
75
void main() {
print("Preinting Statement ");
print("New Update ");
// ************************** Print **************************
// print("Hello Dart ! ");
// print(3 + 5);
// print("3" + "2"); //concatenation of string
// print("3" * 5); // write "3" 5 times
// ************************** Variables **************************
// Datatype variableName = value ;
// int myInt = 10;
// print(myInt);
// //type variableName; // Name Convention
// // Change / transfer the value of a variable
// myInt = 15; //Transfer "myInt" from 10 to 15
// print(myInt);
// ******** Final and Const Variables :
// final date =
// DateTime.now(); // cant be change in the code , computed at run time
// final date1 = 10; // use for the compile time value to enhance performance
// print(date); // print current date
// print(date1); // const value known at compile time
//******** Optional Variable : // Sound Null Safety
// String? st1 = null;
// // String? st12;
// print(st1);
// st1 = "Hello";
// print(st1.length); // length is 5
// st1 = null;
// print(st1?.length ?? 0); // print 0 (if you want not to show 'null')
// print(st1?.length ?? "No value in the string");// print instead of null
// ************************** Datatype **************************
// int a = 2;
// int b = 7;
// double c = 0.001;
// String name = "Aqsam";
// bool isage = false;
// // "dynamic" you can use any datatype under dynamic datatype :
// dynamic anyvar1 = 56;
// dynamic anyvar2 = 0.98;
// dynamic anyvar3 = "Aqsam";
// dynamic anyvar4 = false;
// print(a + b);
// print(c);
// print(name);
// print(isage);
// print(anyvar1);
// ************************** If Statemnt **************************
}