mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: Standardize precision used in communityRating (#424)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
d421bb13e6
commit
ca7cd827e1
3 changed files with 29 additions and 31 deletions
|
|
@ -68,32 +68,28 @@ class ItemBaseModel with ItemBaseModelMappable {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget? subTitle(SortingOptions options) => switch (options) {
|
Widget? subTitle(SortingOptions options) => switch (options) {
|
||||||
SortingOptions.parentalRating => overview.parentalRating != null
|
SortingOptions.parentalRating => Row(
|
||||||
? Row(
|
children: [
|
||||||
children: [
|
const Icon(
|
||||||
const Icon(
|
IconsaxPlusBold.star_1,
|
||||||
IconsaxPlusBold.star_1,
|
size: 14,
|
||||||
size: 14,
|
color: Colors.yellowAccent,
|
||||||
color: Colors.yellowAccent,
|
),
|
||||||
),
|
const SizedBox(width: 6),
|
||||||
const SizedBox(width: 6),
|
Text(overview.parentalRating?.toString() ?? "--"),
|
||||||
Text((overview.parentalRating ?? 0.0).toString())
|
],
|
||||||
],
|
),
|
||||||
)
|
SortingOptions.communityRating => Row(
|
||||||
: null,
|
children: [
|
||||||
SortingOptions.communityRating => overview.communityRating != null
|
const Icon(
|
||||||
? Row(
|
IconsaxPlusBold.star_1,
|
||||||
children: [
|
size: 14,
|
||||||
const Icon(
|
color: Colors.yellowAccent,
|
||||||
IconsaxPlusBold.star_1,
|
),
|
||||||
size: 14,
|
const SizedBox(width: 6),
|
||||||
color: Colors.yellowAccent,
|
Text(overview.communityRating?.toStringAsFixed(2) ?? "--"),
|
||||||
),
|
],
|
||||||
const SizedBox(width: 6),
|
),
|
||||||
Text((overview.communityRating ?? 0.0).toString())
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ class OverviewHeader extends ConsumerWidget {
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
communityRating?.toStringAsFixed(1) ?? "",
|
communityRating?.toStringAsFixed(2) ?? "",
|
||||||
style: subStyle,
|
style: subStyle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -83,13 +83,15 @@ class PosterWidget extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
if (subTitle != null) ...[
|
if (subTitle != null) ...[
|
||||||
Opacity(
|
Flexible(
|
||||||
opacity: opacity,
|
child: Opacity(
|
||||||
child: subTitle!,
|
opacity: opacity,
|
||||||
|
child: subTitle!,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const Spacer()
|
|
||||||
],
|
],
|
||||||
if (poster.subText?.isNotEmpty ?? false)
|
if (poster.subText?.isNotEmpty ?? false)
|
||||||
Flexible(
|
Flexible(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue