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.
cloudsolutions-atoms/lib/models/new_models/department.dart

44 lines
1.1 KiB
Dart

import '../base.dart';
class Department extends Base {
Department({
this.id,
this.departmentName,
this.departmentCode,
this.ntCode,
}) : super(identifier: id.toString(), name: departmentName);
Department.fromJson(dynamic json) {
id = json['id'];
identifier = id.toString();
departmentName = json['departmentName'] ?? json['name'];
name = departmentName;
departmentCode = json['departmentCode'];
ntCode = json['ntCode'];
}
num id;
String departmentName;
String departmentCode;
String ntCode;
Department copyWith({
num id,
String departmentName,
String departmentCode,
String ntCode,
}) =>
Department(
id: id ?? this.id,
departmentName: departmentName ?? this.departmentName,
departmentCode: departmentCode ?? this.departmentCode,
ntCode: ntCode ?? this.ntCode,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['departmentName'] = departmentName;
map['departmentCode'] = departmentCode;
map['ntCode'] = ntCode;
return map;
}
}