Skip to content

Commit

Permalink
fix: Extra versbose semantic label
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 18, 2024
1 parent 27096ac commit cdd5333
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions lib/src/components/avatars/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
///
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/badges/indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cdd5333

Please sign in to comment.