Fix attachments not show when click ShowAll button

(cherry picked from commit 15f4dabd8c2dd8417ca4350ad736fb9929dcc6d6)
This commit is contained in:
dab246
2023-06-15 17:10:55 +07:00
committed by Dat Vu
parent 36a09827cf
commit 365a04a083
@@ -352,28 +352,6 @@ abstract class BaseComposerView extends GetWidget<ComposerController>
) {
const double maxHeightItem = 60;
if (expandMode == ExpandMode.EXPAND) {
if (PlatformInfo.isWeb) {
return const SizedBox.shrink();
} else {
return LayoutBuilder(builder: (context, constraints) {
return GridView.builder(
key: const Key('list_attachment_full'),
primary: false,
shrinkWrap: true,
itemCount: uploadFilesState.length,
gridDelegate: SliverGridDelegateFixedHeight(
height: maxHeightItem,
crossAxisCount: ComposerStyle.getMaxItemRowListAttachment(context, constraints),
crossAxisSpacing: 8.0,
mainAxisSpacing: 8.0),
itemBuilder: (context, index) => AttachmentFileComposerBuilder(
uploadFilesState[index],
onDeleteAttachmentAction: (attachment) => controller.deleteAttachmentUploaded(attachment.uploadTaskId)
)
);
});
}
} else {
if (PlatformInfo.isWeb) {
return LayoutBuilder(builder: (context, constraints) {
return Align(
@@ -399,6 +377,28 @@ abstract class BaseComposerView extends GetWidget<ComposerController>
)
);
});
} else {
return LayoutBuilder(builder: (context, constraints) {
return GridView.builder(
key: const Key('list_attachment_full'),
primary: false,
shrinkWrap: true,
itemCount: uploadFilesState.length,
gridDelegate: SliverGridDelegateFixedHeight(
height: maxHeightItem,
crossAxisCount: ComposerStyle.getMaxItemRowListAttachment(context, constraints),
crossAxisSpacing: 8.0,
mainAxisSpacing: 8.0),
itemBuilder: (context, index) => AttachmentFileComposerBuilder(
uploadFilesState[index],
onDeleteAttachmentAction: (attachment) => controller.deleteAttachmentUploaded(attachment.uploadTaskId)
)
);
});
}
} else {
if (PlatformInfo.isWeb) {
return const SizedBox.shrink();
} else {
return LayoutBuilder(builder: (context, constraints) {
return Align(