- Added `ApiService` class for handling API requests related to projects and employees. - Implemented methods to fetch projects and employees by project ID with JWT authentication. - Enhanced `AuthService` to store JWT and refresh tokens upon user login. - Updated `LocalStorage` to manage JWT and refresh tokens. - Created models for `AttendanceModel`, `EmployeeModel`, and `ProjectModel` to structure data. - Introduced `AttendanceScreen` for displaying attendance data with a new UI layout. - Removed deprecated `attendance_screen.dart` and replaced it with `attendanceScreen.dart`. - Updated routing to reflect the new attendance screen structure. - Integrated geolocation and permission handling plugins for enhanced functionality. - Updated dependencies in `pubspec.yaml` and `pubspec.lock` for new packages.
29 lines
779 B
Dart
29 lines
779 B
Dart
class EmployeeModel {
|
|
final int id;
|
|
final String name;
|
|
final String designation;
|
|
final String checkIn;
|
|
final String checkOut;
|
|
final int actions;
|
|
|
|
EmployeeModel({
|
|
required this.id,
|
|
required this.name,
|
|
required this.designation,
|
|
required this.checkIn,
|
|
required this.checkOut,
|
|
required this.actions,
|
|
});
|
|
|
|
factory EmployeeModel.fromJson(Map<String, dynamic> json) {
|
|
return EmployeeModel(
|
|
id: json['employeeId'] ?? 0,
|
|
name: '${json['firstName']} ${json['lastName']}',
|
|
designation: json['jobRoleName'] ?? '',
|
|
checkIn: json['checkIn'] ?? '-', // Make sure your API returns this field
|
|
checkOut: json['checkOut'] ?? '-',
|
|
actions: json['actions'] ?? 0, // Make sure your API returns this field
|
|
);
|
|
}
|
|
}
|