Skip to content

Instantly share code, notes, and snippets.

View junddao's full-sized avatar
:octocat:

Miro junddao

:octocat:
View GitHub Profile
@junddao
junddao / main.dart
Created June 9, 2023 02:24
dart 3.0 _ class
void main() {
}
// 주의 : (같은 파일에서는 가능하다)
// final 로 클래스를 선언하면
// extends, implement 또는 mixin 으로 사용 불가능하다
final class Person{
final String name;
final int age;
@junddao
junddao / main.dart
Last active June 9, 2023 02:14
dart 3.0 _ pattern matching
// pattern matching
void main() {
//validation
final user = ('miro', 30);
// build time 이 아닌 runtime에서 error 나게 할수 있음
final (name as String, age as int) = user;
@junddao
junddao / main.dart
Created June 9, 2023 00:55
dart 3.0_ destructuring
// destructuring
// record로 넘어온 값을 한방에 변수에 할당해서 써주는 기술
// 어떤 구조든 패턴만 맞춰주면 destructuring 가능
void main() {
// final user = ('하하', 20);
// String name = user.$1;
// int age = user.$2;
@junddao
junddao / main.dart
Last active December 19, 2023 08:52
dart 3.0_record
// record
// 순서와 타입을 보장해 주는 자료형
void main() {
final result = nameAndAge({
'name': '하하',
'age': 20,
});
@junddao
junddao / main.dart
Created March 10, 2023 04:48
inheritance-problem-pre 
// 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{
@junddao
junddao / main.dart
Last active March 10, 2023 04:46
inheritance-problem 
// 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{
@junddao
junddao / main.dart
Last active October 19, 2022 06:50
graph search two points
// 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';
/**
@junddao
junddao / main.dart
Last active October 18, 2022 01:52
leetcode 227
void main() {
Solution solution = Solution();
print(solution.calculate("14-3/2"));
}
class Solution {
int calculate(String s) {
List<String> chs = s.split('');
@junddao
junddao / main.dart
Created October 17, 2022 13:16
leetcode 227
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}
@junddao
junddao / main.dart
Created October 13, 2022 12:39
leetcode 100
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}