TF-4000 Display all attachments in email detailed view
This commit is contained in:
@@ -26,6 +26,7 @@ class EmailAttachmentsWidget extends StatelessWidget {
|
|||||||
final ImagePaths imagePaths;
|
final ImagePaths imagePaths;
|
||||||
final OnTapActionCallback? onTapShowAllAttachmentFile;
|
final OnTapActionCallback? onTapShowAllAttachmentFile;
|
||||||
final bool showDownloadAllAttachmentsButton;
|
final bool showDownloadAllAttachmentsButton;
|
||||||
|
final bool isDisplayAllAttachments;
|
||||||
final OnTapActionCallback? onTapDownloadAllButton;
|
final OnTapActionCallback? onTapDownloadAllButton;
|
||||||
final String? singleEmailControllerTag;
|
final String? singleEmailControllerTag;
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ class EmailAttachmentsWidget extends StatelessWidget {
|
|||||||
this.viewAttachmentAction,
|
this.viewAttachmentAction,
|
||||||
this.onTapShowAllAttachmentFile,
|
this.onTapShowAllAttachmentFile,
|
||||||
this.showDownloadAllAttachmentsButton = false,
|
this.showDownloadAllAttachmentsButton = false,
|
||||||
|
this.isDisplayAllAttachments = true,
|
||||||
this.onTapDownloadAllButton,
|
this.onTapDownloadAllButton,
|
||||||
this.singleEmailControllerTag,
|
this.singleEmailControllerTag,
|
||||||
});
|
});
|
||||||
@@ -230,6 +232,7 @@ class EmailAttachmentsWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
|
runSpacing: isDisplayAllAttachments ? 8 : 0,
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
...displayedAttachments.map((attachment) {
|
...displayedAttachments.map((attachment) {
|
||||||
@@ -282,6 +285,10 @@ class EmailAttachmentsWidget extends StatelessWidget {
|
|||||||
|
|
||||||
({List<Attachment> displayedAttachments, int hiddenItemsCount})
|
({List<Attachment> displayedAttachments, int hiddenItemsCount})
|
||||||
_getDisplayedAndHiddenAttachment(BuildContext context, double maxWidth) {
|
_getDisplayedAndHiddenAttachment(BuildContext context, double maxWidth) {
|
||||||
|
if (isDisplayAllAttachments) {
|
||||||
|
return (displayedAttachments: attachments, hiddenItemsCount: 0);
|
||||||
|
}
|
||||||
|
|
||||||
final displayedAttachments = EmailUtils.getAttachmentDisplayed(
|
final displayedAttachments = EmailUtils.getAttachmentDisplayed(
|
||||||
maxWidth: maxWidth,
|
maxWidth: maxWidth,
|
||||||
attachments: attachments,
|
attachments: attachments,
|
||||||
|
|||||||
Reference in New Issue
Block a user