From 55f89c544928df6fa8ee9c6f47e86a0aadd79567 Mon Sep 17 00:00:00 2001 From: abhishekvyas Date: Mon, 12 May 2025 17:40:44 +0530 Subject: [PATCH 1/2] ZDS fixes --- lib/src/components/organisms/chat/message_input.dart | 11 ++++++++--- lib/src/utils/assets/icons.dart | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/src/components/organisms/chat/message_input.dart b/lib/src/components/organisms/chat/message_input.dart index cc564163..43432715 100644 --- a/lib/src/components/organisms/chat/message_input.dart +++ b/lib/src/components/organisms/chat/message_input.dart @@ -32,6 +32,7 @@ class ZdsMessageInput extends StatefulWidget { this.moreConfig, this.inlineConfig, this.moreOptionItemStyle = ZdsFilePickerOptionItemStyle.vertical, + this.addAttachment, super.key, }) : assert( (allowVoiceNotes && voiceNoteFileName != null) || !allowVoiceNotes, @@ -100,6 +101,9 @@ class ZdsMessageInput extends StatefulWidget { /// The maximum pixel size of any image sent as an attachment. final int maxPixelSize; + /// The value of Add Attachment in localised language. + final String? addAttachment; + /// Custom configuration for the file picker that appears when the attachment button is clicked. /// /// If not provided, a default configuration will be used. @@ -165,7 +169,8 @@ class ZdsMessageInput extends StatefulWidget { ..add(IterableProperty('postProcessors', postProcessors)) ..add(DiagnosticsProperty('moreConfig', moreConfig)) ..add(DiagnosticsProperty('inlineConfig', inlineConfig)) - ..add(EnumProperty('optionItemStyle', moreOptionItemStyle)); + ..add(EnumProperty('optionItemStyle', moreOptionItemStyle)) + ..add(StringProperty('addAttachment', addAttachment)); } } @@ -443,7 +448,7 @@ class ZdsMessageInputState extends State with SingleTickerProvi unawaited( showZdsBottomSheet( - enforceSheet: true, + // enforceSheet: true, backgroundColor: zetaColors.surfacePrimary, context: context, maxHeight: maxSheetHeight, @@ -464,7 +469,7 @@ class ZdsMessageInputState extends State with SingleTickerProvi identifier: 'drawer_title', container: true, child: Text( - ComponentStrings.of(context).get('ADD_ATTACHMENTS', 'Add Attachments'), + widget.addAttachment ?? ComponentStrings.of(context).get('ADD', 'Add'), style: ZetaTextStyles.h5, overflow: TextOverflow.ellipsis, ), diff --git a/lib/src/utils/assets/icons.dart b/lib/src/utils/assets/icons.dart index 141efbe5..d053f706 100644 --- a/lib/src/utils/assets/icons.dart +++ b/lib/src/utils/assets/icons.dart @@ -366,6 +366,7 @@ const Map _extensions = { '.png': ZdsIcons.file_image_o, '.bmp': ZdsIcons.file_image_o, '.ppt': ZdsIcons.file_powerpoint_o, + '.ppr': ZdsIcons.file_powerpoint_o, '.pptx': ZdsIcons.file_powerpoint_o, '.qt': ZdsIcons.file_o, '.rar': ZdsIcons.file_archive_o, @@ -408,6 +409,7 @@ Color iconColor(String ext, {BuildContext? context}) { case '.pdf': case '.ppt': + case '.ppr': case '.pptx': return colors?.red ?? const Color(0xFFDB0D00); From ec4a901fb39de7bca94e0e94c1b68b341a05d0a7 Mon Sep 17 00:00:00 2001 From: abhishekvyas Date: Mon, 12 May 2025 18:13:26 +0530 Subject: [PATCH 2/2] Requested changes applied --- lib/src/components/organisms/chat/message_input.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/src/components/organisms/chat/message_input.dart b/lib/src/components/organisms/chat/message_input.dart index 43432715..04c2e55c 100644 --- a/lib/src/components/organisms/chat/message_input.dart +++ b/lib/src/components/organisms/chat/message_input.dart @@ -33,6 +33,7 @@ class ZdsMessageInput extends StatefulWidget { this.inlineConfig, this.moreOptionItemStyle = ZdsFilePickerOptionItemStyle.vertical, this.addAttachment, + this.enforceSheet = true, super.key, }) : assert( (allowVoiceNotes && voiceNoteFileName != null) || !allowVoiceNotes, @@ -104,6 +105,9 @@ class ZdsMessageInput extends StatefulWidget { /// The value of Add Attachment in localised language. final String? addAttachment; + /// The value of enforceSheet is used to show bottom sheet. + final bool enforceSheet; + /// Custom configuration for the file picker that appears when the attachment button is clicked. /// /// If not provided, a default configuration will be used. @@ -170,7 +174,8 @@ class ZdsMessageInput extends StatefulWidget { ..add(DiagnosticsProperty('moreConfig', moreConfig)) ..add(DiagnosticsProperty('inlineConfig', inlineConfig)) ..add(EnumProperty('optionItemStyle', moreOptionItemStyle)) - ..add(StringProperty('addAttachment', addAttachment)); + ..add(StringProperty('addAttachment', addAttachment)) + ..add(DiagnosticsProperty('enforceSheet', enforceSheet)); } } @@ -448,7 +453,7 @@ class ZdsMessageInputState extends State with SingleTickerProvi unawaited( showZdsBottomSheet( - // enforceSheet: true, + enforceSheet: widget.enforceSheet, backgroundColor: zetaColors.surfacePrimary, context: context, maxHeight: maxSheetHeight,