Cascade Notation(캐스케이드 표기법)
class Coffee { String name; int price; String ice; Coffee({ required this.name, required this.price, required this.ice, }); void letsOrder() { print("Your order is $name , Price $price won , with $ice"); } } void main() { var jason = Coffee( name: "Americano", price: 5500, ice: "hot", ); jason.letsOrder(); } //결과: Your order is Americano , Price 5500 won , with hot 위와 같이 생성한 class의 변수를 바꿀 수 있는데,..
앱개발/Dart
2023. 7. 4. 16:58