From 34211336f95cd4eeb5521cd39f971a88aebaff59 Mon Sep 17 00:00:00 2001 From: KG3497 Date: Mon, 10 Feb 2025 14:52:36 +0530 Subject: [PATCH 1/8] WFCNG-18672"adding option to add position and set menu item color to white" --- lib/src/components/molecules/comment.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index c2e93686..3f620b17 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -22,6 +22,7 @@ class ZdsComment extends StatelessWidget { this.replySemanticLabel, this.attachmentThumbnail, this.menuItems, + this.menuPosition = ZdsPopupMenuPosition.bottomRight, this.onMenuItemSelected, }) : assert( onReply != null && replySemanticLabel != null || onReply == null && replySemanticLabel == null, @@ -78,6 +79,9 @@ class ZdsComment extends StatelessWidget { /// If defined, the pouup menu will be shown when the user taps on the comment. final List>? menuItems; + /// The popup menu position to display in the popup menu items. + final ZdsPopupMenuPosition? menuPosition; + /// The callback to be called when a menu item is selected. /// Menu items must be given a value for the callback to trigger. final ValueChanged? onMenuItemSelected; @@ -201,13 +205,13 @@ class ZdsComment extends StatelessWidget { ); if (menuItems != null) { return ZdsPopupMenu( - menuPosition: ZdsPopupMenuPosition.topRight, + menuPosition: menuPosition ?? ZdsPopupMenuPosition.topRight, verticalOffset: spacing.small, items: menuItems ?? [], onSelected: onMenuItemSelected, builder: (context, open) { return Material( - color: colors.surfaceDefault, + color: colors.white, child: InkWell( onTap: open, child: child, @@ -216,7 +220,7 @@ class ZdsComment extends StatelessWidget { }, ); } - return ColoredBox(color: colors.surfaceDefault, child: child); + return ColoredBox(color: colors.white, child: child); }, ), ); @@ -241,7 +245,8 @@ class ZdsComment extends StatelessWidget { ..add(ObjectFlagProperty.has('downloadCallback', downloadCallback)) ..add(StringProperty('deleteSemanticLabel', deleteSemanticLabel)) ..add(StringProperty('replySemanticLabel', replySemanticLabel)) - ..add(ObjectFlagProperty?>.has('onMenuItemSelected', onMenuItemSelected)); + ..add(EnumProperty('menuPosition', menuPosition)) + ..add(ObjectFlagProperty?>.has('onMenuItemSelected', onMenuItemSelected)); } } From 1da9518652ef30a51eedd493f26f80956a248868 Mon Sep 17 00:00:00 2001 From: KG3497 Date: Mon, 10 Feb 2025 14:53:17 +0530 Subject: [PATCH 2/8] WFCNG-18672"formatting done" --- lib/src/components/molecules/comment.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index 3f620b17..23e98f8d 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -246,7 +246,7 @@ class ZdsComment extends StatelessWidget { ..add(StringProperty('deleteSemanticLabel', deleteSemanticLabel)) ..add(StringProperty('replySemanticLabel', replySemanticLabel)) ..add(EnumProperty('menuPosition', menuPosition)) - ..add(ObjectFlagProperty?>.has('onMenuItemSelected', onMenuItemSelected)); + ..add(ObjectFlagProperty?>.has('onMenuItemSelected', onMenuItemSelected)); } } From 496b6248ba06c62ef7dd3aaa8d5b65dbc172a99d Mon Sep 17 00:00:00 2001 From: KG3497 Date: Tue, 11 Feb 2025 13:13:46 +0530 Subject: [PATCH 3/8] WFCNG-18672"change color to surface primary " --- lib/src/components/molecules/comment.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index 23e98f8d..c4d19b43 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -211,7 +211,7 @@ class ZdsComment extends StatelessWidget { onSelected: onMenuItemSelected, builder: (context, open) { return Material( - color: colors.white, + color: colors.surfacePrimary, child: InkWell( onTap: open, child: child, @@ -220,7 +220,7 @@ class ZdsComment extends StatelessWidget { }, ); } - return ColoredBox(color: colors.white, child: child); + return ColoredBox(color: colors.surfacePrimary, child: child); }, ), ); From ed481f5d8d1ec815388ef8746e52a2f93712b131 Mon Sep 17 00:00:00 2001 From: KG3497 Date: Fri, 14 Feb 2025 16:22:48 +0530 Subject: [PATCH 4/8] WFCNG-18672"change color in background of row to surface primary " --- lib/src/components/molecules/comment.dart | 269 +++++++++++----------- 1 file changed, 138 insertions(+), 131 deletions(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index c2e93686..3b6fa6aa 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -22,14 +22,15 @@ class ZdsComment extends StatelessWidget { this.replySemanticLabel, this.attachmentThumbnail, this.menuItems, + this.menuPosition = ZdsPopupMenuPosition.bottomRight, this.onMenuItemSelected, }) : assert( - onReply != null && replySemanticLabel != null || onReply == null && replySemanticLabel == null, - 'replySemanticLabel must be not null if onReply is defined', - ), + onReply != null && replySemanticLabel != null || onReply == null && replySemanticLabel == null, + 'replySemanticLabel must be not null if onReply is defined', + ), assert( - onDelete != null && deleteSemanticLabel != null || onDelete == null && deleteSemanticLabel == null, - 'deleteSemanticLabel must be not null if onDelete is defined', + onDelete != null && deleteSemanticLabel != null || onDelete == null && deleteSemanticLabel == null, + 'deleteSemanticLabel must be not null if onDelete is defined', ); /// The comment text. @@ -78,6 +79,8 @@ class ZdsComment extends StatelessWidget { /// If defined, the pouup menu will be shown when the user taps on the comment. final List>? menuItems; + final ZdsPopupMenuPosition menuPosition; + /// The callback to be called when a menu item is selected. /// Menu items must be given a value for the callback to trigger. final ValueChanged? onMenuItemSelected; @@ -87,143 +90,146 @@ class ZdsComment extends StatelessWidget { final colors = Zeta.of(context).colors; final spacing = Zeta.of(context).spacing; - return Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (isReply) - Padding( - padding: EdgeInsets.only( - left: spacing.large, - right: spacing.minimum, - top: spacing.minimum, - ), - child: const ZetaIcon( - ZetaIcons.reply, - size: 24, - applyTextScaling: true, + return Container( + color: colors.surfacePrimary, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (isReply) + Padding( + padding: EdgeInsets.only( + left: spacing.large, + right: spacing.minimum, + top: spacing.minimum, + ), + child: const ZetaIcon( + ZetaIcons.reply, + size: 24, + applyTextScaling: true, + ), ), - ), - Expanded( - child: LayoutBuilder( - builder: (context, constraints) { - return ZdsSlidableListTile( - width: constraints.maxWidth, - elevation: 0, - actions: [ - if (!isReply && onReply != null && replySemanticLabel != null) - ZdsSlidableAction( - icon: ZetaIcons.reply, - semanticLabel: replySemanticLabel, - foregroundColor: colors.primary, - backgroundColor: colors.surfacePrimarySubtle, - onPressed: (_) => onReply!(), - ), - if (onDelete != null && deleteSemanticLabel != null) - ZdsSlidableAction( - icon: ZetaIcons.delete, - semanticLabel: deleteSemanticLabel, - onPressed: (_) => onDelete!(), - backgroundColor: colors.surfaceNegativeSubtle, - foregroundColor: colors.error, - ), - ], - child: Builder( - builder: (context) { - final child = Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: colors.borderSubtle, - ), - ), + Expanded( + child: LayoutBuilder( + builder: (context, constraints) { + return ZdsSlidableListTile( + width: constraints.maxWidth, + elevation: 0, + actions: [ + if (!isReply && onReply != null && replySemanticLabel != null) + ZdsSlidableAction( + icon: ZetaIcons.reply, + semanticLabel: replySemanticLabel, + foregroundColor: colors.primary, + backgroundColor: colors.surfacePrimarySubtle, + onPressed: (_) => onReply!(), ), - padding: EdgeInsets.symmetric( - vertical: spacing.large, - horizontal: spacing.medium, + if (onDelete != null && deleteSemanticLabel != null) + ZdsSlidableAction( + icon: ZetaIcons.delete, + semanticLabel: deleteSemanticLabel, + onPressed: (_) => onDelete!(), + backgroundColor: colors.surfaceNegativeSubtle, + foregroundColor: colors.error, ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: spacing.minimum), - child: Row( - children: [ - if (avatar != null) - Padding( - padding: EdgeInsets.only(right: spacing.small), - child: avatar, - ), - if (author != null) - Expanded( - child: Text( - author!, - style: ZetaTextStyles.labelLarge.copyWith( - fontWeight: FontWeight.w500, - ), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ), - if (timeStamp != null) - Padding( - padding: EdgeInsets.only(left: spacing.small), - child: Text( - timeStamp!, - style: ZetaTextStyles.bodyXSmall.copyWith(color: colors.textSubtle), - ), - ), - ], + ], + child: Builder( + builder: (context) { + final child = Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: colors.borderSubtle, ), ), - if (comment != null) + ), + padding: EdgeInsets.symmetric( + vertical: spacing.large, + horizontal: spacing.medium, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Padding( - padding: EdgeInsets.only( - top: spacing.small, - left: spacing.minimum, - right: spacing.minimum, - ), - child: Text( - comment!, - style: Theme.of(context).textTheme.bodyMedium, + padding: EdgeInsets.symmetric(horizontal: spacing.minimum), + child: Row( + children: [ + if (avatar != null) + Padding( + padding: EdgeInsets.only(right: spacing.small), + child: avatar, + ), + if (author != null) + Expanded( + child: Text( + author!, + style: ZetaTextStyles.labelLarge.copyWith( + fontWeight: FontWeight.w500, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + if (timeStamp != null) + Padding( + padding: EdgeInsets.only(left: spacing.small), + child: Text( + timeStamp!, + style: ZetaTextStyles.bodyXSmall.copyWith(color: colors.textSubtle), + ), + ), + ], ), ), - if (attachment != null) - Padding( - padding: EdgeInsets.only(top: spacing.medium), - child: _AttachmentRow( - attachment: attachment!, - downloadCallback: downloadCallback, - customThumbnail: attachmentThumbnail, + if (comment != null) + Padding( + padding: EdgeInsets.only( + top: spacing.small, + left: spacing.minimum, + right: spacing.minimum, + ), + child: Text( + comment!, + style: Theme.of(context).textTheme.bodyMedium, + ), ), - ), - ], - ), - ); - if (menuItems != null) { - return ZdsPopupMenu( - menuPosition: ZdsPopupMenuPosition.topRight, - verticalOffset: spacing.small, - items: menuItems ?? [], - onSelected: onMenuItemSelected, - builder: (context, open) { - return Material( - color: colors.surfaceDefault, - child: InkWell( - onTap: open, - child: child, - ), - ); - }, + if (attachment != null) + Padding( + padding: EdgeInsets.only(top: spacing.medium), + child: _AttachmentRow( + attachment: attachment!, + downloadCallback: downloadCallback, + customThumbnail: attachmentThumbnail, + ), + ), + ], + ), ); - } - return ColoredBox(color: colors.surfaceDefault, child: child); - }, - ), - ); - }, + if (menuItems != null) { + return ZdsPopupMenu( + verticalOffset: spacing.small, + menuPosition: menuPosition, + items: menuItems ?? [], + onSelected: onMenuItemSelected, + builder: (context, open) { + return Material( + color: colors.surfacePrimary, + child: InkWell( + onTap: open, + child: child, + ), + ); + }, + ); + } + return ColoredBox(color: colors.surfacePrimary, child: child); + }, + ), + ); + }, + ), ), - ), - ], + ], + ), ); } @@ -241,6 +247,7 @@ class ZdsComment extends StatelessWidget { ..add(ObjectFlagProperty.has('downloadCallback', downloadCallback)) ..add(StringProperty('deleteSemanticLabel', deleteSemanticLabel)) ..add(StringProperty('replySemanticLabel', replySemanticLabel)) + ..add(EnumProperty('menuPosition', menuPosition)) ..add(ObjectFlagProperty?>.has('onMenuItemSelected', onMenuItemSelected)); } } From ba8c06371479992aa363b4f435ed37be1411e99b Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 14 Feb 2025 11:02:44 +0000 Subject: [PATCH 5/8] chore(automated): Lint commit and format --- lib/src/components/molecules/comment.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index ffe848d1..2771454a 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -25,12 +25,12 @@ class ZdsComment extends StatelessWidget { this.menuPosition = ZdsPopupMenuPosition.bottomRight, this.onMenuItemSelected, }) : assert( - onReply != null && replySemanticLabel != null || onReply == null && replySemanticLabel == null, - 'replySemanticLabel must be not null if onReply is defined', - ), + onReply != null && replySemanticLabel != null || onReply == null && replySemanticLabel == null, + 'replySemanticLabel must be not null if onReply is defined', + ), assert( - onDelete != null && deleteSemanticLabel != null || onDelete == null && deleteSemanticLabel == null, - 'deleteSemanticLabel must be not null if onDelete is defined', + onDelete != null && deleteSemanticLabel != null || onDelete == null && deleteSemanticLabel == null, + 'deleteSemanticLabel must be not null if onDelete is defined', ); /// The comment text. From 98a7455a5ed7e0004338daaab267045606220a40 Mon Sep 17 00:00:00 2001 From: KG3497 Date: Fri, 14 Feb 2025 16:42:17 +0530 Subject: [PATCH 6/8] WFCNG-18672"formatting" --- lib/src/components/molecules/comment.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index ffe848d1..2771454a 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -25,12 +25,12 @@ class ZdsComment extends StatelessWidget { this.menuPosition = ZdsPopupMenuPosition.bottomRight, this.onMenuItemSelected, }) : assert( - onReply != null && replySemanticLabel != null || onReply == null && replySemanticLabel == null, - 'replySemanticLabel must be not null if onReply is defined', - ), + onReply != null && replySemanticLabel != null || onReply == null && replySemanticLabel == null, + 'replySemanticLabel must be not null if onReply is defined', + ), assert( - onDelete != null && deleteSemanticLabel != null || onDelete == null && deleteSemanticLabel == null, - 'deleteSemanticLabel must be not null if onDelete is defined', + onDelete != null && deleteSemanticLabel != null || onDelete == null && deleteSemanticLabel == null, + 'deleteSemanticLabel must be not null if onDelete is defined', ); /// The comment text. From 7b879c803c5f71acca9fe4acc4e88d70bff01323 Mon Sep 17 00:00:00 2001 From: KG3497 Date: Fri, 14 Feb 2025 17:16:36 +0530 Subject: [PATCH 7/8] WFCNG-18672"replacing container" --- lib/src/components/molecules/comment.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/components/molecules/comment.dart b/lib/src/components/molecules/comment.dart index 2771454a..982e876c 100644 --- a/lib/src/components/molecules/comment.dart +++ b/lib/src/components/molecules/comment.dart @@ -91,7 +91,7 @@ class ZdsComment extends StatelessWidget { final colors = Zeta.of(context).colors; final spacing = Zeta.of(context).spacing; - return Container( + return ColoredBox( color: colors.surfacePrimary, child: Row( crossAxisAlignment: CrossAxisAlignment.start, From 2e8b41e80e2ad5cb29c71d9f93111f2da1742543 Mon Sep 17 00:00:00 2001 From: KG3497 Date: Thu, 5 Jun 2025 16:49:29 +0530 Subject: [PATCH 8/8] WFCNG-24007 "added new file present icon as default file _extensions" --- lib/src/utils/assets/icons.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/utils/assets/icons.dart b/lib/src/utils/assets/icons.dart index 53b8d76e..02d13faf 100644 --- a/lib/src/utils/assets/icons.dart +++ b/lib/src/utils/assets/icons.dart @@ -459,7 +459,7 @@ Color iconColor(String ext, {BuildContext? context}) { } IconData extensionIcon(String ext) { - return _extensions[ext._safeExt] ?? ZdsIcons.file_o; + return _extensions[ext._safeExt] ?? ZdsIcons.file_present; } extension IconDataFromExt on String {