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_room_combined.dart

56 lines
1.5 KiB
Dart

import 'package:test_sa/models/base.dart';
class DepartmentRoomCombined extends Base {
final int? deptId;
final int? roomId;
final String? deptName;
final String? roomName;
final String? locationDescriptionName;
final String? deptAndRoomName;
DepartmentRoomCombined({
this.deptId,
this.roomId,
this.deptName,
this.roomName,
this.locationDescriptionName,
this.deptAndRoomName,
}) : super(
identifier: '${deptId}_${roomId}',
name: deptAndRoomName ?? '${deptName ?? ''} / ${roomName ?? ''}',
);
factory DepartmentRoomCombined.fromJson(Map<String, dynamic> json) {
return DepartmentRoomCombined(
deptId: json['deptId'],
roomId: json['roomId'],
deptName: json['deptName'],
roomName: json['roomName'],
locationDescriptionName: json['locationDescriptionName'],
deptAndRoomName: json['deptAndRoomName'],
);
}
Map<String, dynamic> toJson() {
return {
'deptId': deptId,
'roomId': roomId,
'deptName': deptName,
'roomName': roomName,
'locationDescriptionName': locationDescriptionName,
'deptAndRoomName': deptAndRoomName,
};
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DepartmentRoomCombined &&
runtimeType == other.runtimeType &&
deptId == other.deptId &&
roomId == other.roomId;
@override
int get hashCode => deptId.hashCode ^ roomId.hashCode;
}