Skip to content

Instantly share code, notes, and snippets.

View gyugyu90's full-sized avatar
🎯
Focusing

Kyuhyeok Park gyugyu90

🎯
Focusing
  • Seoul, Republic of Korea
View GitHub Profile
class Headphone {
double volume = 5;
void increaseVolume() {
if (volume == 10) {
print('최고 볼륨입니다!');
return;
}
volume++;
abstract class Language {
factory Language(String languageCode) {
if (languageCode == 'ko') {
return Korean();
}
return English();
}
void sayHello();
class Logger {
static final Logger _instance = Logger._internal('MyApplication');
String prefix;
Logger._internal(this.prefix);
factory Logger() {
return _instance;
}
class Coffee {
String beanType;
int waterAmount;
bool hot;
Syrup? syrup;
Coffee(this.beanType, [this.waterAmount = 40, this.hot = true, this.syrup]);
Coffee.iceAmericano(this.beanType, this.waterAmount, [this.syrup])
: hot = false;
class Coffee {
String beanType;
int waterAmount;
bool hot;
Syrup? syrup;
Coffee(this.beanType,
[this.waterAmount = 40, this.hot = true, this.syrup]);
// named constructor
class Tea {
final String teaBag;
Milk? milk;
late String allergyInfo;
Tea(this.teaBag, [this.milk]);
}
class Milk {
String name = "서울우유";
class Tea {
final String teaBag;
Milk? milk;
Tea(this.teaBag, [this.milk]);
String getFullName() {
if (milk != null) {
return "$teaBag 밀크티";
}
class Tea {
String teaBag = "얼그레이";
Milk? milk;
String getFullName() {
if (milk != null) {
return "$teaBag 밀크티";
}
return "$teaBag 티";
class Syrup {
String name;
int amount;
Syrup(this.name, this.amount);
}
class Coffee {
String beanType;
int waterAmount;
class Syrup {
String name;
int amount;
Syrup(this.name, this.amount);
}
class Coffee {
String beanType;
int waterAmount;