with1 Dart with (Mixin) 이해하기 클래스를 상속받는 것 외에 with를 통해 다른 클래스의 멤버 변수와 멤버 함수를 사용할 수 있습니다. with (Mixin)을 사용해 다른 클래스의 멤버 함수를 사용해보겠습니다. class Human { String name; int age; Human({ required this.name, required this.age, }); void intro() { print("My name is $name and I'm $age years old."); } } class Student extends Human with highScore{ final int number; Student({ required String name, required int age, required this.number, }) : s.. 2023. 1. 7. 이전 1 다음