Copy void main () {
// Object Class in Dart
var manager1 = Manager ( "Alpha" , 1 , 12 , "John" , "Doe" );
var employee1 = Employee ( 1 , 12 , "John" , "Doe" );
print (manager1. toString ());
}
class Employee {
int id;
int dayworked;
String firstname;
String lastname;
String fullname () {
return this.firstname + " " + this.lastname;
}
int salary ( int perDaywage) {
return (this.dayworked * perDaywage);
}
@override
String toString () {
return "id: $id , dayworked: $dayworked , firstname : $firstname ,lastname: $lastname " ;
}
Employee (this.id, this.dayworked, this.firstname, this.lastname);
}
// Manager Class
class Manager extends Employee {
//property
String project;
//Method
String manageproject () {
return "Managing project " + " " + this.project;
}
@override
String toString () {
return " ${super. toString ()} project: $project " ;
}
Manager (this.project, int id, int dayworked, String firstname, String lastname)
: super(id, dayworked, firstname, lastname);
}