|
|
|
@ -24,13 +24,13 @@ import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
class AssetDeliveryAttachmentView extends StatefulWidget {
|
|
|
|
class AssetDeliveryAttachmentView extends StatefulWidget {
|
|
|
|
final int? tableItemId;
|
|
|
|
final int? tableItemId;
|
|
|
|
final int? attachmentType;
|
|
|
|
final int? attachmentType;
|
|
|
|
bool viewOnly = false;
|
|
|
|
// bool viewOnly = false;
|
|
|
|
final List<GenericAttachmentModel> attachmentList;
|
|
|
|
final List<GenericAttachmentModel> attachmentList;
|
|
|
|
|
|
|
|
|
|
|
|
AssetDeliveryAttachmentView({
|
|
|
|
AssetDeliveryAttachmentView({
|
|
|
|
super.key,
|
|
|
|
super.key,
|
|
|
|
required this.attachmentList,
|
|
|
|
required this.attachmentList,
|
|
|
|
this.viewOnly = false,
|
|
|
|
// this.viewOnly = false,
|
|
|
|
this.attachmentType,
|
|
|
|
this.attachmentType,
|
|
|
|
this.tableItemId,
|
|
|
|
this.tableItemId,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -83,7 +83,8 @@ class _AssetDeliveryAttachmentViewState extends State<AssetDeliveryAttachmentVie
|
|
|
|
fit: FlexFit.loose,
|
|
|
|
fit: FlexFit.loose,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
widget.attachmentType == 5 && !widget.viewOnly
|
|
|
|
// widget.attachmentType == 5 && !widget.viewOnly
|
|
|
|
|
|
|
|
widget.attachmentType == 5 //only add the attachment for current
|
|
|
|
? AttachmentPicker(
|
|
|
|
? AttachmentPicker(
|
|
|
|
label: context.translation.attachments,
|
|
|
|
label: context.translation.attachments,
|
|
|
|
attachment: _attachments,
|
|
|
|
attachment: _attachments,
|
|
|
|
@ -98,16 +99,18 @@ class _AssetDeliveryAttachmentViewState extends State<AssetDeliveryAttachmentVie
|
|
|
|
padding: 12,
|
|
|
|
padding: 12,
|
|
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: FilesList(images: _attachments.map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList() ?? []).toShadowContainer(
|
|
|
|
: _attachments.isNotEmpty
|
|
|
|
|
|
|
|
? FilesList(images: _attachments.map((e) => URLs.getFileUrl(e.name ?? '') ?? '').toList() ?? []).toShadowContainer(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
borderRadius: 20,
|
|
|
|
borderRadius: 20,
|
|
|
|
padding: 12,
|
|
|
|
padding: 12,
|
|
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
: const NoDataFound().center.expanded,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (widget.attachmentType == 5 && !widget.viewOnly)
|
|
|
|
if (widget.attachmentType == 5)
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
child: AppFilledButton(
|
|
|
|
child: AppFilledButton(
|
|
|
|
|