- Implemented ReportActionBottomSheet for reporting actions on tasks. - Created TaskActionButtons for handling report and comment actions. - Added WorkStatusResponseModel and WorkStatus model for managing work statuses. - Refactored DailyProgressReportScreen to utilize new action buttons for reporting and commenting. - Enhanced task data preparation for reporting and commenting actions.
54 lines
1.2 KiB
Dart
54 lines
1.2 KiB
Dart
class WorkStatusResponseModel {
|
|
final bool success;
|
|
final String message;
|
|
final List<WorkStatus> data;
|
|
final dynamic errors;
|
|
final int statusCode;
|
|
final DateTime timestamp;
|
|
|
|
WorkStatusResponseModel({
|
|
required this.success,
|
|
required this.message,
|
|
required this.data,
|
|
required this.errors,
|
|
required this.statusCode,
|
|
required this.timestamp,
|
|
});
|
|
|
|
factory WorkStatusResponseModel.fromJson(Map<String, dynamic> json) {
|
|
return WorkStatusResponseModel(
|
|
success: json['success'],
|
|
message: json['message'],
|
|
data: List<WorkStatus>.from(
|
|
json['data'].map((item) => WorkStatus.fromJson(item)),
|
|
),
|
|
errors: json['errors'],
|
|
statusCode: json['statusCode'],
|
|
timestamp: DateTime.parse(json['timestamp']),
|
|
);
|
|
}
|
|
}
|
|
|
|
class WorkStatus {
|
|
final String id;
|
|
final String name;
|
|
final String description;
|
|
final bool isSystem;
|
|
|
|
WorkStatus({
|
|
required this.id,
|
|
required this.name,
|
|
required this.description,
|
|
required this.isSystem,
|
|
});
|
|
|
|
factory WorkStatus.fromJson(Map<String, dynamic> json) {
|
|
return WorkStatus(
|
|
id: json['id'],
|
|
name: json['name'],
|
|
description: json['description'],
|
|
isSystem: json['isSystem'],
|
|
);
|
|
}
|
|
}
|