From cdd5333299a11142786c2a04cd081131a0edc707 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 18 Nov 2024 11:11:02 +0000 Subject: [PATCH] fix: Extra versbose semantic label --- .../pages/components/notification_list_example.dart | 1 + lib/src/components/avatars/avatar.dart | 12 ++++++------ lib/src/components/badges/indicator.dart | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/example/lib/pages/components/notification_list_example.dart b/example/lib/pages/components/notification_list_example.dart index a13ae1ad..1b203145 100644 --- a/example/lib/pages/components/notification_list_example.dart +++ b/example/lib/pages/components/notification_list_example.dart @@ -86,6 +86,7 @@ class NotificationListItemExample extends StatelessWidget { leading: ZetaNotificationBadge.avatar( avatar: ZetaAvatar.initials( initials: "JS", + semanticUpperBadgeLabel: 'Urgent', lowerBadge: ZetaAvatarBadge.icon( color: ZetaColors().surfacePositive, icon: Icons.check, diff --git a/lib/src/components/avatars/avatar.dart b/lib/src/components/avatars/avatar.dart index 7ca1443f..726c381b 100644 --- a/lib/src/components/avatars/avatar.dart +++ b/lib/src/components/avatars/avatar.dart @@ -53,9 +53,9 @@ class ZetaAvatar extends ZetaStatelessWidget { this.lowerBadge, this.upperBadge, this.borderColor, - this.semanticLabel = 'avatar', - this.semanticUpperBadgeLabel = 'upperBadge', - this.semanticLowerBadgeLabel = 'lowerBadge', + this.semanticLabel, + this.semanticUpperBadgeLabel, + this.semanticLowerBadgeLabel, this.initialTextStyle, this.label, this.labelTextStyle, @@ -149,17 +149,17 @@ class ZetaAvatar extends ZetaStatelessWidget { /// {@template zeta-widget-semantic-label} /// This label is used by accessibility frameworks (e.g. TalkBack on Android) to describe the component. /// {@endtemplate} - final String semanticLabel; + final String? semanticLabel; /// Value passed into wrapping [Semantics] widget for lower badge. /// /// {@macro zeta-widget-semantic-label} - final String semanticLowerBadgeLabel; + final String? semanticLowerBadgeLabel; /// Value passed into wrapping [Semantics] widget for upper badge. /// /// {@macro zeta-widget-semantic-label} - final String semanticUpperBadgeLabel; + final String? semanticUpperBadgeLabel; /// Text style for initials. /// diff --git a/lib/src/components/badges/indicator.dart b/lib/src/components/badges/indicator.dart index bba6bb94..efbb3d4e 100644 --- a/lib/src/components/badges/indicator.dart +++ b/lib/src/components/badges/indicator.dart @@ -114,6 +114,7 @@ class ZetaIndicator extends ZetaStatelessWidget { return Semantics( label: semanticLabel, + container: true, child: Container( width: sizePixels + Zeta.of(context).spacing.minimum, height: sizePixels + Zeta.of(context).spacing.minimum,