Created
May 29, 2023 02:08
-
-
Save LokieVikky/34488a2fd9b426b6e3301ada08dc742b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// Nullability | |
// ? | |
// ! | |
// String? name; | |
// name!.isEmpty; | |
// List<String> names = []; | |
// // for In Loop | |
// for (String name in names) { | |
// } | |
// // for loop | |
// for (int i = 0; i < names.length; i++) { | |
// } | |
// // while | |
// int i = 0; | |
// while(i < 10){ | |
// print(i); | |
// i++; | |
// } | |
// // do while | |
// do{ | |
// }while(i< 20); | |
String? firstName = null; | |
String lastName = 'kandan'; | |
print('$firstName $lastName'); | |
// concatenation | |
print(firstName + ' ' + lastName); | |
// Interpolation | |
print('${firstName.length}'); | |
function1(null,''); | |
function2('',v2: ''); | |
String userName = firstName ?? 'Default'; | |
print(userName); | |
var test = Test(); | |
} | |
class Test{ | |
} | |
void function1(String? v1, String v2){ | |
} | |
void function2(String? v1, {String v2 = ''}){ | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment