Skip to content

Commit 79b019b

Browse files
committed
fix(ms_store): do not show 'Not Rated' product ratings
1 parent 707b661 commit 79b019b

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/lib/features/ms_store/ms_store_product_page.dart

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class _HeroSection extends ConsumerWidget {
349349
children: [
350350
_HeroIcon(
351351
iconUrl: details.iconUrl,
352-
color: parseHexColor(details.iconUrlBackground!),
352+
color: parseHexColor(details.iconUrlBackground ?? ''),
353353
),
354354
Column(
355355
mainAxisSize: .min,
@@ -449,7 +449,8 @@ class _HeroSection extends ConsumerWidget {
449449
],
450450
),
451451
if (details.productRatings != null &&
452-
details.productRatings!.isNotEmpty)
452+
details.productRatings!.isNotEmpty &&
453+
details.productRatings!.first.ratingId != 'Microsoft:E')
453454
Wrap(
454455
spacing: 12,
455456
crossAxisAlignment: .end,
@@ -470,22 +471,24 @@ class _HeroSection extends ConsumerWidget {
470471
mainAxisSize: .min,
471472
children: [
472473
Text(
473-
details.productRatings!.first.longName ?? '',
474+
details.productRatings?.first.longName ?? '',
474475
style: theme.typography.bodyStrong,
475476
),
476477
Text(
477-
details.productRatings!.first.ratingDescriptors!
478-
.join(', '),
478+
details.productRatings?.first.ratingDescriptors
479+
?.join(', ') ??
480+
'',
479481
style: theme.typography.caption!.copyWith(
480482
color: theme.resources.textFillColorDisabled,
481483
),
482484
),
483485
Text(
484486
details
485-
.productRatings!
486-
.first
487-
.interactiveElements!
488-
.join(', '),
487+
.productRatings
488+
?.first
489+
.interactiveElements
490+
?.join(', ') ??
491+
'',
489492
style: theme.typography.caption!.copyWith(
490493
color: theme.resources.textFillColorDisabled,
491494
),
@@ -801,7 +804,11 @@ class _AdditionalInfoSection extends StatelessWidget {
801804
items.add((
802805
msicons.FluentIcons.bookmark_16_regular,
803806
'Category',
804-
(details.categories?.toString().replaceAll('[', '').replaceAll(']', '')) ?? 'N/A',
807+
(details.categories
808+
?.toString()
809+
.replaceAll('[', '')
810+
.replaceAll(']', '')) ??
811+
'N/A',
805812
));
806813

807814
items.add((

0 commit comments

Comments
 (0)