Skip to content

Commit

Permalink
change semantic value to label
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton committed Jun 28, 2024
1 parent 82b028c commit 0e9ea15
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions lib/src/components/avatars/avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class ZetaAvatar extends ZetaStatelessWidget {
this.lowerBadge,
this.upperBadge,
this.borderColor,
this.semanticValue = 'avatar',
this.semanticUpperBadgeValue = 'upperBadge',
this.semanticLowerBadgeValue = 'lowerBadge',
this.semanticLabel = 'avatar',
this.semanticUpperBadgeLabel = 'upperBadge',
this.semanticLowerBadgeLabel = 'lowerBadge',
});

/// Constructor for [ZetaAvatar] with image.
Expand All @@ -57,9 +57,9 @@ class ZetaAvatar extends ZetaStatelessWidget {
this.lowerBadge,
this.upperBadge,
this.borderColor,
this.semanticValue = 'avatar',
this.semanticUpperBadgeValue = 'upperBadge',
this.semanticLowerBadgeValue = 'lowerBadge',
this.semanticLabel = 'avatar',
this.semanticUpperBadgeLabel = 'upperBadge',
this.semanticLowerBadgeLabel = 'lowerBadge',
}) : backgroundColor = null,
initials = null;

Expand All @@ -72,9 +72,9 @@ class ZetaAvatar extends ZetaStatelessWidget {
this.upperBadge,
this.borderColor,
this.backgroundColor,
this.semanticValue = 'avatar',
this.semanticUpperBadgeValue = 'upperBadge',
this.semanticLowerBadgeValue = 'lowerBadge',
this.semanticLabel = 'avatar',
this.semanticUpperBadgeLabel = 'upperBadge',
this.semanticLowerBadgeLabel = 'lowerBadge',
}) : image = null;

/// Constructor for [ZetaAvatar] with initials from a full name.
Expand All @@ -86,9 +86,9 @@ class ZetaAvatar extends ZetaStatelessWidget {
this.upperBadge,
this.borderColor,
this.backgroundColor,
this.semanticValue = 'avatar',
this.semanticUpperBadgeValue = 'upperBadge',
this.semanticLowerBadgeValue = 'lowerBadge',
this.semanticLabel = 'avatar',
this.semanticUpperBadgeLabel = 'upperBadge',
this.semanticLowerBadgeLabel = 'lowerBadge',
}) : image = null,
initials = name.initials;

Expand Down Expand Up @@ -120,17 +120,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 semanticValue;
final String semanticLabel;

/// Value passed into wrapping [Semantics] widget for lower badge.
///
/// {@macro zeta-widget-semantic-label}
final String semanticLowerBadgeValue;
final String semanticLowerBadgeLabel;

/// Value passed into wrapping [Semantics] widget for upper badge.
///
/// {@macro zeta-widget-semantic-label}
final String semanticUpperBadgeValue;
final String semanticUpperBadgeLabel;

/// Return copy of avatar with certain changed fields
ZetaAvatar copyWith({
Expand Down Expand Up @@ -186,7 +186,7 @@ class ZetaAvatar extends ZetaStatelessWidget {
return ZetaRoundedScope(
rounded: context.rounded,
child: Semantics(
value: semanticValue,
value: semanticLabel,
child: SelectionContainer.disabled(
child: Stack(
children: [
Expand Down Expand Up @@ -227,7 +227,7 @@ class ZetaAvatar extends ZetaStatelessWidget {
Positioned(
right: ZetaSpacing.none,
child: Semantics(
value: semanticLowerBadgeValue,
value: semanticLowerBadgeLabel,
child: upperBadge!.copyWith(
size: size,
),
Expand All @@ -238,7 +238,7 @@ class ZetaAvatar extends ZetaStatelessWidget {
right: ZetaSpacing.none,
bottom: ZetaSpacing.none,
child: Semantics(
value: semanticLowerBadgeValue,
value: semanticLowerBadgeLabel,
child: lowerBadge!.copyWith(size: size),
),
),
Expand All @@ -259,9 +259,9 @@ class ZetaAvatar extends ZetaStatelessWidget {
..add(DiagnosticsProperty<ZetaAvatarBadge?>('badge', upperBadge))
..add(DiagnosticsProperty<Color?>('backgroundColor', backgroundColor))
..add(ColorProperty('statusColor', borderColor))
..add(StringProperty('semanticUpperBadgeValue', semanticUpperBadgeValue))
..add(StringProperty('semanticValue', semanticValue))
..add(StringProperty('semanticLowerBadgeValue', semanticLowerBadgeValue));
..add(StringProperty('semanticUpperBadgeValue', semanticUpperBadgeLabel))
..add(StringProperty('semanticValue', semanticLabel))
..add(StringProperty('semanticLowerBadgeValue', semanticLowerBadgeLabel));
}
}

Expand Down

0 comments on commit 0e9ea15

Please sign in to comment.