cascade operator1 Dart Cascade Notation Cascade Notation에 알아보기 위해 먼저 클래스를 생성하고 그 값을 변경하는 코드를 작성하겠습니다. class Human { String name; int age; String hair; Human({ required this.name, required this.age, required this.hair, }); void intro() { print("My name is $name and I'm $age years old. My hair-color is $hair"); } } void main() { var human = Human(name: 'name', age: 20, hair: 'gold'); human.age = 21; human.hair = 'silver'; human.name = '.. 2023. 1. 5. 이전 1 다음