|
|
|
|
@ -33,49 +33,51 @@ class IncidentDetailPage extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: const DefaultAppBar(title: "Request Details"),
|
|
|
|
|
body: FutureBuilder<IncidentDataModel?>(
|
|
|
|
|
future: Provider.of<IncidentProvider>(context, listen: false).getIncidentById(incidentId),
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<IncidentDataModel?> snapshot) {
|
|
|
|
|
if (snapshot.connectionState == ConnectionState.waiting) return CircularProgressIndicator(color: AppColor.loadingColor(context)).center;
|
|
|
|
|
if (snapshot.data == null) return const NoDataFound().center;
|
|
|
|
|
body: SafeArea(
|
|
|
|
|
child: FutureBuilder<IncidentDataModel?>(
|
|
|
|
|
future: Provider.of<IncidentProvider>(context, listen: false).getIncidentById(incidentId),
|
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<IncidentDataModel?> snapshot) {
|
|
|
|
|
if (snapshot.connectionState == ConnectionState.waiting) return CircularProgressIndicator(color: AppColor.loadingColor(context)).center;
|
|
|
|
|
if (snapshot.data == null) return const NoDataFound().center;
|
|
|
|
|
|
|
|
|
|
List<IncidentAttachments> allAttachments = snapshot.data!.incidentAttachments!;
|
|
|
|
|
List<IncidentAttachments> allAttachments = snapshot.data!.incidentAttachments!;
|
|
|
|
|
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
StatusLabel(
|
|
|
|
|
label: snapshot.data!.incidentStatusName!,
|
|
|
|
|
textColor: AppColor.getRequestStatusTextColorByName(context, snapshot.data!.incidentStatusName!),
|
|
|
|
|
backgroundColor: AppColor.getRequestStatusColorByName(context, snapshot.data!.incidentStatusName!),
|
|
|
|
|
),
|
|
|
|
|
1.width.expanded,
|
|
|
|
|
InfoDateWidget(snapshot.data!.createdDate?.toString() ?? ""),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// 12.height,
|
|
|
|
|
...requesterDetails(context, snapshot.data!),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
...requestDetails(context, snapshot.data!),
|
|
|
|
|
if (snapshot.data!.ovrTicketNumber?.isNotEmpty ?? false) ovrInformation(context, snapshot.data!.ovrTicketNumber!),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
...assetDetails(context, snapshot.data!),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
...personInvolvedDetails(context, snapshot.data!),
|
|
|
|
|
if (allAttachments.isNotEmpty) ...[
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
StatusLabel(
|
|
|
|
|
label: snapshot.data!.incidentStatusName!,
|
|
|
|
|
textColor: AppColor.getRequestStatusTextColorByName(context, snapshot.data!.incidentStatusName!),
|
|
|
|
|
backgroundColor: AppColor.getRequestStatusColorByName(context, snapshot.data!.incidentStatusName!),
|
|
|
|
|
),
|
|
|
|
|
1.width.expanded,
|
|
|
|
|
InfoDateWidget(snapshot.data!.createdDate?.toString() ?? ""),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// 12.height,
|
|
|
|
|
...requesterDetails(context, snapshot.data!),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
...requestDetails(context, snapshot.data!),
|
|
|
|
|
if (snapshot.data!.ovrTicketNumber?.isNotEmpty ?? false) ovrInformation(context, snapshot.data!.ovrTicketNumber!),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
InfoHeader16Widget("Attachments".addTranslation),
|
|
|
|
|
FilesList(images: allAttachments.map((e) => URLs.getFileUrl(e.attachmentName ?? '') ?? '').toList() ?? []),
|
|
|
|
|
...assetDetails(context, snapshot.data!),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
...personInvolvedDetails(context, snapshot.data!),
|
|
|
|
|
if (allAttachments.isNotEmpty) ...[
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
InfoHeader16Widget("Attachments".addTranslation),
|
|
|
|
|
FilesList(images: allAttachments.map((e) => URLs.getFileUrl(e.attachmentName ?? '') ?? '').toList() ?? []),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context),
|
|
|
|
|
);
|
|
|
|
|
}));
|
|
|
|
|
).toShadowContainer(context),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> requestDetails(BuildContext context, IncidentDataModel incidentData) {
|
|
|
|
|
|