TF-4000 Set the Show all attachment button to be hidden by default
This commit is contained in:
@@ -14,6 +14,7 @@ class AttachmentsInfo extends StatelessWidget {
|
|||||||
required this.numberOfAttachments,
|
required this.numberOfAttachments,
|
||||||
required this.totalSizeInfo,
|
required this.totalSizeInfo,
|
||||||
required this.responsiveUtils,
|
required this.responsiveUtils,
|
||||||
|
this.displayShowAll = false,
|
||||||
this.onTapShowAllAttachmentFile,
|
this.onTapShowAllAttachmentFile,
|
||||||
this.onTapDownloadAllButton,
|
this.onTapDownloadAllButton,
|
||||||
});
|
});
|
||||||
@@ -22,6 +23,7 @@ class AttachmentsInfo extends StatelessWidget {
|
|||||||
final int numberOfAttachments;
|
final int numberOfAttachments;
|
||||||
final String totalSizeInfo;
|
final String totalSizeInfo;
|
||||||
final ResponsiveUtils responsiveUtils;
|
final ResponsiveUtils responsiveUtils;
|
||||||
|
final bool displayShowAll;
|
||||||
final VoidCallback? onTapShowAllAttachmentFile;
|
final VoidCallback? onTapShowAllAttachmentFile;
|
||||||
final VoidCallback? onTapDownloadAllButton;
|
final VoidCallback? onTapDownloadAllButton;
|
||||||
|
|
||||||
@@ -49,19 +51,6 @@ class AttachmentsInfo extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final showAllButton = TMailButtonWidget.fromText(
|
|
||||||
text: AppLocalizations.of(context).showAll,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
textStyle: ThemeUtils.textStyleBodyBody1().copyWith(
|
|
||||||
color: AppColor.steelGray400,
|
|
||||||
),
|
|
||||||
borderRadius: 5,
|
|
||||||
maxLines: 1,
|
|
||||||
maxWidth: 120,
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 5),
|
|
||||||
onTapActionCallback: onTapShowAllAttachmentFile,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (responsiveUtils.isMobile(context)) {
|
if (responsiveUtils.isMobile(context)) {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -72,7 +61,8 @@ class AttachmentsInfo extends StatelessWidget {
|
|||||||
child: titleHeaderAttachment,
|
child: titleHeaderAttachment,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (numberOfAttachments > 3) showAllButton,
|
if (displayShowAll && numberOfAttachments > 3)
|
||||||
|
_buildShowAllButton(context),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -89,7 +79,8 @@ class AttachmentsInfo extends StatelessWidget {
|
|||||||
child: titleHeaderAttachment,
|
child: titleHeaderAttachment,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (numberOfAttachments > 4) showAllButton,
|
if (displayShowAll && numberOfAttachments > 4)
|
||||||
|
_buildShowAllButton(context),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -116,4 +107,19 @@ class AttachmentsInfo extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildShowAllButton(BuildContext context) {
|
||||||
|
return TMailButtonWidget.fromText(
|
||||||
|
text: AppLocalizations.of(context).showAll,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
textStyle: ThemeUtils.textStyleBodyBody1().copyWith(
|
||||||
|
color: AppColor.steelGray400,
|
||||||
|
),
|
||||||
|
borderRadius: 5,
|
||||||
|
maxLines: 1,
|
||||||
|
maxWidth: 120,
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 5),
|
||||||
|
onTapActionCallback: onTapShowAllAttachmentFile,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user