From 365a04a08364644e6cec2f9e0c7913822875ee8a Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 15 Jun 2023 17:10:55 +0700 Subject: [PATCH] Fix attachments not show when click ShowAll button (cherry picked from commit 15f4dabd8c2dd8417ca4350ad736fb9929dcc6d6) --- .../presentation/base_composer_view.dart | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/features/composer/presentation/base_composer_view.dart b/lib/features/composer/presentation/base_composer_view.dart index fb8e3036c..532b36342 100644 --- a/lib/features/composer/presentation/base_composer_view.dart +++ b/lib/features/composer/presentation/base_composer_view.dart @@ -352,28 +352,6 @@ abstract class BaseComposerView extends GetWidget ) { 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 ) ); }); + } 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(