Skip to content

Commit e367205

Browse files
authored
fix(cat-voices): align colors with designs (#940)
1 parent 931b337 commit e367205

File tree

6 files changed

+37
-7
lines changed

6 files changed

+37
-7
lines changed

catalyst_voices/lib/widgets/indicators/voices_no_internet_connection_banner.dart

+14-5
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ class NoInternetConnectionBanner extends StatelessWidget {
3535
return LayoutBuilder(
3636
builder: (context, constraints) {
3737
final shouldButtonDisplay = constraints.maxWidth > 744;
38+
final foregroundColor = Theme.of(context).colorScheme.errorContainer;
3839

3940
return Container(
4041
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
4142
margin: const EdgeInsets.all(16),
4243
decoration: BoxDecoration(
43-
color: Theme.of(context).colors.avatarsError,
44+
color: Theme.of(context).colorScheme.error,
4445
borderRadius: BorderRadius.circular(8),
4546
),
4647
child: Row(
@@ -56,20 +57,26 @@ class NoInternetConnectionBanner extends StatelessWidget {
5657
children: [
5758
CatalystSvgIcon.asset(
5859
VoicesAssets.icons.wifi.path,
59-
color: Theme.of(context).colors.iconsForeground,
60+
color: foregroundColor,
6061
),
6162
const SizedBox(width: 8),
6263
Expanded(
6364
child: Text(
6465
context.l10n.noConnectionBannerTitle,
65-
style: Theme.of(context).textTheme.titleLarge,
66+
style: Theme.of(context)
67+
.textTheme
68+
.titleLarge
69+
?.copyWith(color: foregroundColor),
6670
),
6771
),
6872
],
6973
),
7074
Text(
7175
context.l10n.noConnectionBannerDescription,
72-
style: Theme.of(context).textTheme.bodySmall,
76+
style: Theme.of(context)
77+
.textTheme
78+
.bodySmall
79+
?.copyWith(color: foregroundColor),
7380
softWrap: true,
7481
),
7582
],
@@ -81,7 +88,9 @@ class NoInternetConnectionBanner extends StatelessWidget {
8188
onTap: onRefresh,
8289
child: Text(
8390
context.l10n.noConnectionBannerRefreshButtonText,
84-
style: Theme.of(context).textTheme.labelLarge,
91+
style: Theme.of(context).textTheme.labelLarge?.copyWith(
92+
color: Theme.of(context).colors.onErrorVariant,
93+
),
8594
),
8695
),
8796
],

catalyst_voices/lib/widgets/indicators/voices_status_indicator.dart

+7-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ class _StatusContainer extends StatelessWidget {
7979
final theme = Theme.of(context);
8080

8181
final backgroundColor = switch (type) {
82+
VoicesStatusIndicatorType.success => theme.colors.success,
83+
VoicesStatusIndicatorType.error => theme.colorScheme.error,
84+
};
85+
86+
final foregroundColor = switch (type) {
8287
VoicesStatusIndicatorType.success => theme.colors.successContainer,
8388
VoicesStatusIndicatorType.error => theme.colors.errorContainer,
8489
};
@@ -92,11 +97,11 @@ class _StatusContainer extends StatelessWidget {
9297
alignment: Alignment.center,
9398
child: DefaultTextStyle(
9499
style: (theme.textTheme.titleLarge ?? const TextStyle())
95-
.copyWith(color: theme.colors.textPrimary),
100+
.copyWith(color: foregroundColor),
96101
child: IconTheme(
97102
data: IconThemeData(
98103
size: 24,
99-
color: theme.colors.textPrimary,
104+
color: foregroundColor,
100105
),
101106
child: child,
102107
),

catalyst_voices/packages/catalyst_voices_assets/assets/colors/colors.xml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<color name="light_outline_variant">#61BFC8D9</color>
2121
<color name="light_error">#CC0000</color>
2222
<color name="light_on_error">#FFFFFF</color>
23+
<color name="light_on_error_variant">#FFFFFF</color>
2324
<color name="light_error_container">#FFD1D1</color>
2425
<color name="light_on_error_container">#700000</color>
2526
<color name="light_success">#218230</color>
@@ -87,6 +88,7 @@
8788
<color name="dark_outline_variant">#364463</color>
8889
<color name="dark_error">#FF9999</color>
8990
<color name="dark_on_error">#380000</color>
91+
<color name="dark_on_error_variant">#FFFFFF</color>
9092
<color name="dark_error_container">#AD0000</color>
9193
<color name="dark_on_error_container">#FFD1D1</color>
9294
<color name="dark_success">#BAEDC2</color>

catalyst_voices/packages/catalyst_voices_assets/lib/generated/colors.gen.dart

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

catalyst_voices/packages/catalyst_voices_brands/lib/src/theme_extensions/voices_color_scheme.dart

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class VoicesColorScheme extends ThemeExtension<VoicesColorScheme> {
6262
final Color? primary98;
6363
final Color? primaryContainer;
6464
final Color? onPrimaryContainer;
65+
final Color? onErrorVariant;
6566
final Color? errorContainer;
6667
final Color? onErrorContainer;
6768

@@ -121,6 +122,7 @@ class VoicesColorScheme extends ThemeExtension<VoicesColorScheme> {
121122
required this.primary98,
122123
required this.primaryContainer,
123124
required this.onPrimaryContainer,
125+
required this.onErrorVariant,
124126
required this.errorContainer,
125127
required this.onErrorContainer,
126128
});
@@ -182,6 +184,7 @@ class VoicesColorScheme extends ThemeExtension<VoicesColorScheme> {
182184
this.primary98,
183185
this.primaryContainer,
184186
this.onPrimaryContainer,
187+
this.onErrorVariant,
185188
this.errorContainer,
186189
this.onErrorContainer,
187190
});
@@ -243,6 +246,7 @@ class VoicesColorScheme extends ThemeExtension<VoicesColorScheme> {
243246
Color? primary98,
244247
Color? primaryContainer,
245248
Color? onPrimaryContainer,
249+
Color? onErrorVariant,
246250
Color? errorContainer,
247251
Color? onErrorContainer,
248252
}) {
@@ -314,6 +318,7 @@ class VoicesColorScheme extends ThemeExtension<VoicesColorScheme> {
314318
primary98: primary98 ?? this.primary98,
315319
primaryContainer: primaryContainer ?? this.primaryContainer,
316320
onPrimaryContainer: onPrimaryContainer ?? this.onPrimaryContainer,
321+
onErrorVariant: onErrorVariant ?? this.onErrorVariant,
317322
errorContainer: errorContainer ?? this.errorContainer,
318323
onErrorContainer: onErrorContainer ?? this.onErrorContainer,
319324
);
@@ -447,6 +452,7 @@ class VoicesColorScheme extends ThemeExtension<VoicesColorScheme> {
447452
primaryContainer: Color.lerp(primaryContainer, other.primaryContainer, t),
448453
onPrimaryContainer:
449454
Color.lerp(onPrimaryContainer, other.onPrimaryContainer, t),
455+
onErrorVariant: Color.lerp(onErrorVariant, other.onErrorVariant, t),
450456
errorContainer: Color.lerp(errorContainer, other.errorContainer, t),
451457
onErrorContainer: Color.lerp(onErrorContainer, other.onErrorContainer, t),
452458
);

catalyst_voices/packages/catalyst_voices_brands/lib/src/themes/catalyst.dart

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const VoicesColorScheme darkVoicesColorScheme = VoicesColorScheme(
8181
primary98: VoicesColors.darkPrimary98,
8282
primaryContainer: VoicesColors.darkPrimaryContainer,
8383
onPrimaryContainer: VoicesColors.darkOnPrimaryContainer,
84+
onErrorVariant: VoicesColors.darkOnErrorVariant,
8485
errorContainer: VoicesColors.darkErrorContainer,
8586
onErrorContainer: VoicesColors.darkOnErrorContainer,
8687
);
@@ -162,6 +163,7 @@ const VoicesColorScheme lightVoicesColorScheme = VoicesColorScheme(
162163
primary98: VoicesColors.lightPrimary98,
163164
primaryContainer: VoicesColors.lightPrimaryContainer,
164165
onPrimaryContainer: VoicesColors.lightOnPrimaryContainer,
166+
onErrorVariant: VoicesColors.lightOnErrorVariant,
165167
errorContainer: VoicesColors.lightErrorContainer,
166168
onErrorContainer: VoicesColors.lightOnErrorContainer,
167169
);

0 commit comments

Comments
 (0)