improvements

main_production_attahment_type
WaseemAbbasi22 1 month ago
parent 448a85522a
commit 55f39fadbc

@ -300,6 +300,7 @@ class OneTimeTaskPreviewScreen extends StatelessWidget {
InfoHeader16Widget( InfoHeader16Widget(
'Attachments', 'Attachments',
), ),
4.height,
FilesList( FilesList(
images: taskData.attachments!.map((attachment) => URLs.getFileUrl(attachment.name ?? '') ?? '').toList(), images: taskData.attachments!.map((attachment) => URLs.getFileUrl(attachment.name ?? '') ?? '').toList(),
showAsListView: true, showAsListView: true,

@ -175,6 +175,7 @@ class _ActivitiesListViewState extends State<ActivitiesListView> {
2.height, 2.height,
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: activity.activitySparePart!.acitiySparePartAttachments! types: activity.activitySparePart!.acitiySparePartAttachments!

@ -266,6 +266,7 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
if (_attachments.isNotEmpty) ...[ if (_attachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
images: _attachments.map((toElement) => URLs.getFileUrl(toElement.name!) ?? '').toList(), images: _attachments.map((toElement) => URLs.getFileUrl(toElement.name!) ?? '').toList(),
@ -299,6 +300,7 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
if (_attachments.isNotEmpty) ...[ if (_attachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
images: _attachments.map((toElement) => URLs.getFileUrl(toElement.name!)!).toList(), images: _attachments.map((toElement) => URLs.getFileUrl(toElement.name!)!).toList(),
showAsListView: true, showAsListView: true,

@ -56,6 +56,7 @@ class DemoActivitiesPage extends StatelessWidget {
if (allAttachments.isNotEmpty) ...[ if (allAttachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: allAttachments types: allAttachments

@ -126,6 +126,7 @@ class _DemoDetailViewPageState extends State<DemoDetailViewPage> {
if (allAttachments.isNotEmpty) ...[ if (allAttachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments"), InfoHeader16Widget("Attachments"),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
images: allAttachments.map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList(), images: allAttachments.map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList(),
@ -134,6 +135,7 @@ class _DemoDetailViewPageState extends State<DemoDetailViewPage> {
if (suppAttachments.isNotEmpty) ...[ if (suppAttachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Supplier Attachments"), InfoHeader16Widget("Supplier Attachments"),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
images: suppAttachments.whereType<GenericAttachmentModel>().map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList(), images: suppAttachments.whereType<GenericAttachmentModel>().map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList(),

@ -71,6 +71,7 @@ class IncidentDetailPage extends StatelessWidget {
if (allAttachments.isNotEmpty) ...[ if (allAttachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: allAttachments types: allAttachments

@ -127,6 +127,7 @@ class _EquipmentInternalAuditDetailPageState extends State<EquipmentInternalAudi
if (allAttachments.isNotEmpty) ...[ if (allAttachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: allAttachments types: allAttachments

@ -83,7 +83,7 @@ class InstallationDetailsView extends StatelessWidget {
"Uploads Phase 2 docs".addTranslation, "Uploads Phase 2 docs".addTranslation,
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
), ),
8.height, 4.height,
FilesList(showAsListView: true, images: loanData.loanAttachments?.map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList() ?? []), FilesList(showAsListView: true, images: loanData.loanAttachments?.map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList() ?? []),
], ],
], ],

@ -97,6 +97,7 @@ class _LoanEquipmentDetailPageState extends State<LoanEquipmentDetailPage> {
if (allAttachments.isNotEmpty) ...[ if (allAttachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: allAttachments types: allAttachments

@ -104,6 +104,7 @@ class _MedicalGasInspectionDetailPageState extends State<MedicalGasInspectionDet
if (model!.deliveryNoteAttachmentDto.isNotEmpty) ...[ if (model!.deliveryNoteAttachmentDto.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: model!.deliveryNoteAttachmentDto types: model!.deliveryNoteAttachmentDto

@ -122,6 +122,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
if (_attachments.isNotEmpty) ...[ if (_attachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: _model?.assetTransferAttachments!=null? types: _model?.assetTransferAttachments!=null?

@ -238,6 +238,7 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
if (_attachments.isNotEmpty) ...[ if (_attachments.isNotEmpty) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: _model.gasRefillAttachments?.whereType<GenericAttachmentModel>().where((e) => e.documentType != null && e.documentType!.name != null).map((toElement) => toElement.documentType!.name!).toList() ?? [], types: _model.gasRefillAttachments?.whereType<GenericAttachmentModel>().where((e) => e.documentType != null && e.documentType!.name != null).map((toElement) => toElement.documentType!.name!).toList() ?? [],

@ -160,6 +160,7 @@ class _TaskRequestDetailsViewState extends State<TaskRequestDetailsView> {
if (taskProvider.taskRequestModel?.taskJobAttachments?.isNotEmpty ?? false) ...[ if (taskProvider.taskRequestModel?.taskJobAttachments?.isNotEmpty ?? false) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FilesList( FilesList(
showAsListView: true, showAsListView: true,
types: taskProvider.taskRequestModel!.taskJobAttachments!.whereType<GenericAttachmentModel>().where((e) => e.name != null).map((toElement) => toElement.documentType?.name ?? '').toList(), types: taskProvider.taskRequestModel!.taskJobAttachments!.whereType<GenericAttachmentModel>().where((e) => e.name != null).map((toElement) => toElement.documentType?.name ?? '').toList(),

@ -318,6 +318,7 @@ class _AssetDetailsViewState extends State<AssetDetailsView> with SingleTickerPr
child: const Divider().defaultStyle(context), child: const Divider().defaultStyle(context),
), ),
InfoHeader16Widget("Attachments".addTranslation), InfoHeader16Widget("Attachments".addTranslation),
4.height,
FadeTransition( FadeTransition(
opacity: attachmentAnimation, opacity: attachmentAnimation,
child: SlideTransition( child: SlideTransition(

@ -115,7 +115,7 @@ class FilesList extends StatelessWidget {
icon: "download".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)), icon: "download".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
tooltip: "Download", // tooltip: "Download",
onPressed: () async { onPressed: () async {
try { try {
if (!await launchUrl(Uri.parse(images[itemIndex]), mode: LaunchMode.externalApplication)) { if (!await launchUrl(Uri.parse(images[itemIndex]), mode: LaunchMode.externalApplication)) {

Loading…
Cancel
Save