|
|
|
|
@ -34,12 +34,13 @@ class ServiceRequestDetailView extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
|
|
|
|
|
List<AttachmentModel> _workOrderAttachments = [];
|
|
|
|
|
List<File> _workOrderAttachments = [];
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
ServiceRequestDetailProvider requestDetailProvider = Provider.of<ServiceRequestDetailProvider>(context, listen: false);
|
|
|
|
|
_workOrderAttachments = requestDetailProvider.currentWorkOrder?.data?.workOrderAttachments.map((e) => AttachmentModel(e.id??0, File(e.name ?? ''))).toList() ?? [];
|
|
|
|
|
_workOrderAttachments = requestDetailProvider.currentWorkOrder?.data?.workOrderAttachments.map((e) => File(e.name ?? '')).toList() ?? [];
|
|
|
|
|
// _workOrderAttachments = requestDetailProvider.currentWorkOrder?.data?.workOrderAttachments.map((e) => AttachmentModel(e.id??0, File(e.name ?? ''))).toList() ?? [];
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -79,9 +80,10 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
|
|
|
|
|
context: context),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (requestProvider.timer != null && requestProvider.timer!.isActive) ...[
|
|
|
|
|
const TimerWidget(),
|
|
|
|
|
]
|
|
|
|
|
//no need to show timer as discussed with backend
|
|
|
|
|
// if (requestProvider.timer != null && requestProvider.timer!.isActive) ...[
|
|
|
|
|
// const TimerWidget(),
|
|
|
|
|
// ]
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
@ -255,10 +257,10 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
|
|
|
|
|
'${context.translation.callResponse}: ${workOrder.callResponse ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'${context.translation.since}: ${workOrder.since != null ? '${workOrder.since} days' : '-'}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
// Text(
|
|
|
|
|
// '${context.translation.since}: ${workOrder.since != null ? '${workOrder.since} days' : '-'}',
|
|
|
|
|
// style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
if (workOrder.rejectReason != null) ...[
|
|
|
|
|
@ -275,7 +277,7 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
Text(
|
|
|
|
|
'${context.translation.comment}: ${workOrder.lastComment ?? '-'}',
|
|
|
|
|
'${context.translation.comment}: ${workOrder.rejectComment ?? '-'}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -296,17 +298,17 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
|
|
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
AttachmentPicker(
|
|
|
|
|
MultiFilesPicker(
|
|
|
|
|
label: context.translation.attachments,
|
|
|
|
|
// files: _workOrderAttachments,
|
|
|
|
|
attachment: _workOrderAttachments,
|
|
|
|
|
files: _workOrderAttachments,
|
|
|
|
|
// attachment: _workOrderAttachments,
|
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
|
onlyImages: false,
|
|
|
|
|
buttonIcon: 'quotation_icon'.toSvgAsset(color: AppColor.primary10),
|
|
|
|
|
onChange: (attachment) {
|
|
|
|
|
print('i am called.');
|
|
|
|
|
// print('attachment value is ${attachment.last.file?.path}');
|
|
|
|
|
// requestProvider.addWorkOrderAttachment(woId: workOrder.requestId!, attachments: _workOrderAttachments);
|
|
|
|
|
requestProvider.addWorkOrderAttachment(woId: workOrder.requestId!, attachments: _workOrderAttachments);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
@ -401,27 +403,27 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'${workOrder.workOrderContactPerson[index].name}',
|
|
|
|
|
'${workOrder.workOrderContactPerson[index].name??'-'}',
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'${context.translation.employeeId}: ${workOrder.workOrderContactPerson[index].employeeId}',
|
|
|
|
|
'${context.translation.employeeId}: ${workOrder.workOrderContactPerson[index].employeeId??'-'}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'${context.translation.telephone}: ${workOrder.workOrderContactPerson[index].mobilePhone}',
|
|
|
|
|
'${context.translation.telephone}: ${workOrder.workOrderContactPerson[index].mobilePhone??'-'}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Job: ${workOrder.workOrderContactPerson[index].position}',
|
|
|
|
|
'Job: ${workOrder.workOrderContactPerson[index].position??'-'}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'${context.translation.email}: ${workOrder.workOrderContactPerson[index].email}',
|
|
|
|
|
'${context.translation.email}: ${workOrder.workOrderContactPerson[index].email??'-'}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Extension: ${workOrder.workOrderContactPerson[index].extension}',
|
|
|
|
|
'Extension: ${workOrder.workOrderContactPerson[index].extension??'-'}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|