This file contains hidden or 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() { | |
} | |
// 주의 : (같은 파일에서는 가능하다) | |
// final 로 클래스를 선언하면 | |
// extends, implement 또는 mixin 으로 사용 불가능하다 | |
final class Person{ | |
final String name; | |
final int age; |
This file contains hidden or 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
// pattern matching | |
void main() { | |
//validation | |
final user = ('miro', 30); | |
// build time 이 아닌 runtime에서 error 나게 할수 있음 | |
final (name as String, age as int) = user; |
This file contains hidden or 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
// destructuring | |
// record로 넘어온 값을 한방에 변수에 할당해서 써주는 기술 | |
// 어떤 구조든 패턴만 맞춰주면 destructuring 가능 | |
void main() { | |
// final user = ('하하', 20); | |
// String name = user.$1; | |
// int age = user.$2; |
This file contains hidden or 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
// record | |
// 순서와 타입을 보장해 주는 자료형 | |
void main() { | |
final result = nameAndAge({ | |
'name': '하하', | |
'age': 20, | |
}); |
This file contains hidden or 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
// 1. User는 Name(String)을 가진다. | |
// 2. Teacher는 id(int)를 가진다. | |
// 3. Teacher는 User이다. | |
// 4. Student는 gpa(String or double)학점을 가진다. | |
// 5. Student는 User이다. | |
// 6. Member는 email을 가진다. | |
// 7. Member는 Teacher와 Student를 가진다. | |
class User{ |
This file contains hidden or 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
// 1. User는 Name(String)을 가진다. | |
// 2. Teacher는 id(int)를 가진다. | |
// 3. Teacher는 User이다. | |
// 4. Student는 gpa(String or double)학점을 가진다. | |
// 5. Student는 User이다. | |
// 6. Member는 email을 가진다. | |
// 7. Member는 Teacher와 Student를 가진다. | |
abstract class User{ |
This file contains hidden or 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
// This is a basic Flutter widget test. | |
// | |
// To perform an interaction with a widget in your test, use the WidgetTester | |
// utility in the flutter_test package. For example, you can send tap and scroll | |
// gestures. You can also use WidgetTester to find child widgets in the widget | |
// tree, read text, and verify that the values of widget properties are correct. | |
import 'dart:collection'; | |
/** |
This file contains hidden or 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() { | |
Solution solution = Solution(); | |
print(solution.calculate("14-3/2")); | |
} | |
class Solution { | |
int calculate(String s) { | |
List<String> chs = s.split(''); | |
This file contains hidden or 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() { | |
for (int i = 0; i < 5; i++) { | |
print('hello ${i + 1}'); | |
} | |
} |
This file contains hidden or 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() { | |
for (int i = 0; i < 5; i++) { | |
print('hello ${i + 1}'); | |
} | |
} |
NewerOlder