You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
457 B
Dart
22 lines
457 B
Dart
class Department{
|
|
String? id;
|
|
String? name;
|
|
|
|
Department({
|
|
this.id,
|
|
this.name,
|
|
});
|
|
|
|
factory Department.fromJson(Map<String,dynamic> parsedJson){
|
|
return Department(
|
|
id: parsedJson["nid"] ?? parsedJson["id"],
|
|
name: parsedJson["dept_name"] ?? parsedJson["value"],
|
|
);
|
|
}
|
|
factory Department.fromDepartment(Department? department){
|
|
return Department(
|
|
id: department?.id,
|
|
name: department?.name,
|
|
);
|
|
}
|
|
} |