일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 웹개발
- Spring
- 쿠키런킹덤
- 티스토리챌린지
- 홀리데이익스프레스
- edwith
- HTML
- Eclipse
- 자바
- Java
- programmers
- 쿠키런킹덤공략
- Unity
- 노마드코더
- 오블완
- dart
- JavaScript
- 유니티
- 딥러닝
- 이클립스
- 쿠킹덤공략
- SQL
- 쿠킹덤
- oracle
- 개발자
- MySQL
- 쿠키런킹덤크리스마스
- 크리스마스
- 프로그래머스
- 자바스크립트
- Today
- Total
목록dart (29)
Dev study and notes
String capitalizeName(String? name) => name?.toUpperCase() ?? 'ANON'; void main() { print(capitalizeName('canada')); print(capitalizeName(null)); // String? name; name ??= 'lunch'; name ??= 'another'; print(name); name = null; name ??= 'another2'; print(name); } // PRINT // >>> // CANADA // ANON // lunch // another2
String sayHello(String name, int age, [String? country = 'Canada']) => "Hello, $name, You are $age, and you come from $country"; void main() { var results = (sayHello("lunch", 100)); print(results); } // PRINT // >>> // Hello, lunch, You are 100, and you come from Canada
String sayHello({String name = "NONE", int age = 0, String country = "NONE"}) { return "Hello, $name, You are $age, and you come from $country"; } String sayHelloRequired( {required String name, required int age, required String country}) { return "Hello, $name, You are $age, and you come from $country"; } void main() { print(sayHello(name: "lunch", age: 100, country: "Canada")); //NULL SAFE pri..
String sayHello(String name) { return "Hello, $name, Nice to meet you."; } // fat arrow sysntax ex1 String sayHelloFAS(String name) => "Hello, $name, Nice to meet you."; // fat arrow sysntax ex2 num add(num a, num b) => a + b; void main() { print(sayHello("lunch")); print(sayHelloFAS("lunch!!!")); print(add(1, 2)); } // PRINT // >>> // Hello, lunch, Nice to meet you. // Hello, lunch!!!, Nice to ..
String sayHello(String name) { return "Hello, $name, Nice to meet you."; } // fat arrow sysntax ex1 String sayHelloFAS(String name) => "Hello, $name, Nice to meet you."; // fat arrow sysntax ex2 num add(num a, num b) => a + b; void main() { print(sayHello("lunch")); print(sayHelloFAS("lunch!!!")); print(add(1, 2)); }
void main() { Set setNumbers = {1, 2, 3, 4}; setNumbers.add(1); setNumbers.add(1); setNumbers.add(1); setNumbers.add(1); print('setNumbers: $setNumbers'); List listNumbers = [1, 2, 3, 4]; listNumbers.add(1); listNumbers.add(1); listNumbers.add(1); listNumbers.add(1); print('listNumbers: $listNumbers'); var varIsSetNumbers = {1, 2, 3, 4}; varIsSetNumbers.add(1); varIsSetNumbers.add(1); varIsSetNu..
void main() { var player = { 'name': 'john', 'xp': 99.99, 'superpower': false, }; print('player: $player'); // Map mapPlayer = { 1: true, 2: false, 3: true, }; print('\nmapPlayer: $mapPlayer'); // Map listPlayer = { [1, 2, 3, 4]: true, [5, 6, 7, 8]: false, }; print('\nlistPlayer: $listPlayer'); // List listMapPlayers = [ { 'name': 'john1', 'xp': 123, }, { 'name': 'john2', 'xp': 12345, } ]; print..
void main() { var oldFriends = ['lunch', 'lynn']; var newFriends = [ 'andrew', 'john', for (var friend in oldFriends) ";D $friend", ]; print(newFriends); } // PRINT // >>> [andrew, john, ;D lunch, ;D lynn]
void main() { var name = 'lunch'; var thisYear = 2023; var greeting = '''Hello, Everyone, My name is $name, Nice to meet you. \'Next\' year is ${thisYear + 1}.'''; print(greeting); }