chore: decrease text sizes in vocab practice complete page in one column mode (#5152)

This commit is contained in:
ggurdin 2026-01-09 11:10:08 -05:00 committed by GitHub
parent 2b118e8185
commit 709126e563
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart';
class StatCard extends StatelessWidget {
final IconData icon;
@ -20,14 +21,32 @@ class StatCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
final theme = Theme.of(context);
final isColumnMode = FluffyThemes.isColumnMode(context);
final colorScheme = theme.colorScheme;
final backgroundColor = isAchievement
? Color.alphaBlend(
Theme.of(context).colorScheme.surface.withAlpha(170),
colorScheme.surface.withAlpha(170),
AppConfig.goldLight,
)
: colorScheme.surfaceContainer;
TextStyle? titleStyle = theme.textTheme.titleMedium;
if (!isColumnMode) {
titleStyle = theme.textTheme.bodyMedium;
}
titleStyle = titleStyle?.copyWith(
fontWeight: FontWeight.bold,
);
TextStyle? achievementStyle = theme.textTheme.titleSmall;
if (!isColumnMode) {
achievementStyle = theme.textTheme.bodySmall;
}
achievementStyle = achievementStyle?.copyWith(
fontWeight: FontWeight.bold,
);
return Container(
decoration: BoxDecoration(
color: backgroundColor,
@ -46,17 +65,13 @@ class StatCard extends StatelessWidget {
const SizedBox(width: 8),
Text(
text,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
),
style: titleStyle,
),
if (isAchievement) ...[
const Spacer(),
Text(
achievementText,
style: Theme.of(context).textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.bold,
),
style: achievementStyle,
),
],
],