Skip to content

Commit

Permalink
Merge pull request #1765 from iserejatoje/main
Browse files Browse the repository at this point in the history
fix: Rating labels low contrast
  • Loading branch information
spydon authored Aug 16, 2024
2 parents 0c8d239 + e2470e2 commit 08d7f6e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/app_center/lib/ratings/ratings_l10n.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:app_center/l10n.dart';
import 'package:app_center_ratings_client/app_center_ratings_client.dart';
import 'package:flutter/material.dart';
import 'package:yaru/theme.dart';

extension RatingsBandL10n on RatingsBand {
String localize(AppLocalizations l10n) {
Expand All @@ -15,12 +16,13 @@ extension RatingsBandL10n on RatingsBand {
}

Color getColor(BuildContext context) {
final colors = Theme.of(context).colorScheme;
return switch (this) {
RatingsBand.veryGood => const Color(0xFF0E8420),
RatingsBand.good => const Color(0xFF0E8420),
RatingsBand.neutral => const Color(0xFFC75A00),
RatingsBand.poor => const Color(0xFFC7162B),
RatingsBand.veryPoor => const Color(0xFFC7162B),
RatingsBand.veryGood => colors.success,
RatingsBand.good => colors.success,
RatingsBand.neutral => colors.warning,
RatingsBand.poor => colors.error,
RatingsBand.veryPoor => colors.error,
RatingsBand.insufficientVotes => Colors.grey,
};
}
Expand Down

0 comments on commit 08d7f6e

Please sign in to comment.