TF-4000 Display all attachments in email detailed view

This commit is contained in:
dab246
2025-09-03 14:29:02 +07:00
committed by Dat H. Pham
parent 7256854538
commit 850a09a281
@@ -26,6 +26,7 @@ class EmailAttachmentsWidget extends StatelessWidget {
final ImagePaths imagePaths;
final OnTapActionCallback? onTapShowAllAttachmentFile;
final bool showDownloadAllAttachmentsButton;
final bool isDisplayAllAttachments;
final OnTapActionCallback? onTapDownloadAllButton;
final String? singleEmailControllerTag;
@@ -40,6 +41,7 @@ class EmailAttachmentsWidget extends StatelessWidget {
this.viewAttachmentAction,
this.onTapShowAllAttachmentFile,
this.showDownloadAllAttachmentsButton = false,
this.isDisplayAllAttachments = true,
this.onTapDownloadAllButton,
this.singleEmailControllerTag,
});
@@ -230,6 +232,7 @@ class EmailAttachmentsWidget extends StatelessWidget {
),
child: Wrap(
spacing: 8,
runSpacing: isDisplayAllAttachments ? 8 : 0,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
...displayedAttachments.map((attachment) {
@@ -282,6 +285,10 @@ class EmailAttachmentsWidget extends StatelessWidget {
({List<Attachment> displayedAttachments, int hiddenItemsCount})
_getDisplayedAndHiddenAttachment(BuildContext context, double maxWidth) {
if (isDisplayAllAttachments) {
return (displayedAttachments: attachments, hiddenItemsCount: 0);
}
final displayedAttachments = EmailUtils.getAttachmentDisplayed(
maxWidth: maxWidth,
attachments: attachments,