Skip to content

Instantly share code, notes, and snippets.

@LokieVikky
Created May 29, 2023 02:08
Show Gist options
  • Save LokieVikky/34488a2fd9b426b6e3301ada08dc742b to your computer and use it in GitHub Desktop.
Save LokieVikky/34488a2fd9b426b6e3301ada08dc742b to your computer and use it in GitHub Desktop.
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