void main() {
var employee = new Employee.fromEmployee("name 1", "female", "e01", 100);
employee.printEmployee();
}
class Human {
late String name;
late String gender;
Human.fromNameAndGender(String name, String gender) {
this.name = name;
this.gender = gender;
}
Human() {}
}
class Employee extends Human {
late String id;
late double salary;
Employee() {
}
Employee.fromEmployee(String name, String gender, String id, double salary)
: super.fromNameAndGender(name, gender) {
this.id = id;
this.salary = salary;
}
void printEmployee() {
print("id: ${this.id}");
print("salary: ${this.salary}");
print("name: ${this.name}");
print("gender: ${this.gender}");
}
}
id: e01
salary: 100.0
name: name 1
gender: female