Add an info icon to the disabled rating filter button title

This commit is contained in:
Vincent Velociter
2026-04-25 11:54:55 +02:00
parent 9cbc787edd
commit 4a5e7bbdeb
+36 -19
View File
@@ -152,7 +152,26 @@ class CreateGameWidget extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Text(context.l10n.ratingFilter, style: labelStyle),
GestureDetector(
onTap: canUseRatingRange
? null
: () => _showDisabledRatingRangeExplanation(context),
child: Row(
mainAxisSize: .min,
children: [
Text(context.l10n.ratingFilter, style: labelStyle),
if (!canUseRatingRange)
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Icon(
Icons.info_outline,
size: 16.0,
color: Theme.of(context).disabledColor,
),
),
],
),
),
OutlinedButton(
style: OutlinedButton.styleFrom(
side: BorderSide(color: Theme.of(context).dividerColor),
@@ -183,24 +202,7 @@ class CreateGameWidget extends ConsumerWidget {
},
);
}
: () {
showAdaptiveDialog<void>(
context: context,
builder: (context) => AlertDialog.adaptive(
content: Text(
context
.l10n
.ratingRangeIsDisabledBecauseYourRatingIsProvisional,
),
actions: [
PlatformDialogAction(
onPressed: () => Navigator.of(context).pop(),
child: Text(context.l10n.mobileOkButton),
),
],
),
);
},
: () => _showDisabledRatingRangeExplanation(context),
child: canUseRatingRange
? Text(
'${playPrefs.customRatingDelta.$1 == 0 ? '-' : ''}${playPrefs.customRatingDelta.$1} / +${playPrefs.customRatingDelta.$2}',
@@ -239,4 +241,19 @@ class CreateGameWidget extends ConsumerWidget {
],
);
}
void _showDisabledRatingRangeExplanation(BuildContext context) {
showAdaptiveDialog<void>(
context: context,
builder: (context) => AlertDialog.adaptive(
content: Text(context.l10n.ratingRangeIsDisabledBecauseYourRatingIsProvisional),
actions: [
PlatformDialogAction(
onPressed: () => Navigator.of(context).pop(),
child: Text(context.l10n.mobileOkButton),
),
],
),
);
}
}