- Added a floating action button to the Layout widget for better accessibility. - Updated the left bar navigation items for clarity and consistency. - Introduced Daily Progress Report and Daily Task Planning screens with comprehensive UI. - Implemented filtering and refreshing functionalities in task planning. - Improved user experience with better spacing and layout adjustments. - Updated pubspec.yaml to include new dependencies for image handling and path management.
75 lines
2.2 KiB
Dart
75 lines
2.2 KiB
Dart
class EmployeeModel {
|
|
final String id;
|
|
final String employeeId;
|
|
final String name;
|
|
final String designation;
|
|
final DateTime? checkIn;
|
|
final DateTime? checkOut;
|
|
final String firstName;
|
|
final String lastName;
|
|
final int activity;
|
|
int action;
|
|
final String jobRole;
|
|
final String email;
|
|
final String phoneNumber;
|
|
final String jobRoleID;
|
|
|
|
EmployeeModel({
|
|
required this.id,
|
|
required this.jobRoleID,
|
|
required this.employeeId,
|
|
required this.name,
|
|
required this.designation,
|
|
this.checkIn,
|
|
this.checkOut,
|
|
required this.firstName,
|
|
required this.lastName,
|
|
required this.activity,
|
|
required this.action,
|
|
required this.jobRole,
|
|
required this.email,
|
|
required this.phoneNumber,
|
|
});
|
|
|
|
factory EmployeeModel.fromJson(Map<String, dynamic> json) {
|
|
return EmployeeModel(
|
|
id: json['id']?.toString() ?? '',
|
|
employeeId: json['employeeId']?.toString() ?? '',
|
|
jobRoleID: json['jobRoleId']?.toString() ?? '',
|
|
name: '${json['firstName'] ?? ''} ${json['lastName'] ?? ''}'.trim(),
|
|
designation: json['jobRoleName'] ?? '',
|
|
checkIn: json['checkInTime'] != null
|
|
? DateTime.tryParse(json['checkInTime'])
|
|
: null,
|
|
checkOut: json['checkOutTime'] != null
|
|
? DateTime.tryParse(json['checkOutTime'])
|
|
: null,
|
|
action: json['action'] ?? 0,
|
|
activity: json['activity'] ?? 0,
|
|
jobRole: json['jobRole']?.toString() ?? '-',
|
|
email: json['email']?.toString() ?? '-',
|
|
phoneNumber: json['phoneNumber']?.toString() ?? '-',
|
|
firstName: json['firstName'] ?? '',
|
|
lastName: json['lastName'] ?? '',
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'employeeId': employeeId,
|
|
'firstName': name.split(' ').first,
|
|
'lastName': name.split(' ').length > 1 ? name.split(' ').last : '',
|
|
'jobRoleId': jobRoleID,
|
|
'jobRoleName': designation,
|
|
'checkInTime': checkIn?.toIso8601String(),
|
|
'checkOutTime': checkOut?.toIso8601String(),
|
|
'action': action,
|
|
'activity': activity,
|
|
'jobRole': jobRole.isEmpty ? '-' : jobRole,
|
|
'email': email.isEmpty ? '-' : email,
|
|
'phoneNumber': phoneNumber.isEmpty ? '-' : phoneNumber,
|
|
};
|
|
}
|
|
}
|