UI bugfixes

This commit is contained in:
franzap
2025-12-16 11:41:47 -03:00
parent a8737163e2
commit ae7a3e45e1
3 changed files with 52 additions and 36 deletions
+13 -3
View File
@@ -47,6 +47,7 @@ class UpdatesScreen extends HookConsumerWidget {
label: 'Updates',
count: updatesCount,
textStyle: tabLabelStyle,
badgeColor: Colors.red.withValues(alpha: 0.4),
),
),
Tab(
@@ -54,6 +55,7 @@ class UpdatesScreen extends HookConsumerWidget {
label: 'Up to date',
count: upToDateCount,
textStyle: tabLabelStyle,
badgeColor: Colors.blue.shade700.withValues(alpha: 0.4),
),
),
Tab(
@@ -61,6 +63,7 @@ class UpdatesScreen extends HookConsumerWidget {
label: 'Bookmarks',
count: bookmarksCount,
textStyle: tabLabelStyle,
badgeColor: Colors.blue.shade700.withValues(alpha: 0.4),
),
),
],
@@ -641,11 +644,13 @@ class _TabLabelWithBadge extends StatelessWidget {
required this.label,
required this.count,
this.textStyle,
this.badgeColor,
});
final String label;
final int count;
final TextStyle? textStyle;
final Color? badgeColor;
@override
Widget build(BuildContext context) {
@@ -659,7 +664,11 @@ class _TabLabelWithBadge extends StatelessWidget {
children: [
Text(label),
if (count > 0)
Positioned(top: -6, right: -18, child: _CountBadge(count: count)),
Positioned(
top: -6,
right: -18,
child: _CountBadge(count: count, color: badgeColor),
),
],
),
),
@@ -668,9 +677,10 @@ class _TabLabelWithBadge extends StatelessWidget {
}
class _CountBadge extends StatelessWidget {
const _CountBadge({required this.count});
const _CountBadge({required this.count, this.color});
final int count;
final Color? color;
@override
Widget build(BuildContext context) {
@@ -679,7 +689,7 @@ class _CountBadge extends StatelessWidget {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: Colors.red.withValues(alpha: 0.4),
color: color ?? Colors.red.withValues(alpha: 0.4),
borderRadius: BorderRadius.circular(9),
),
constraints: const BoxConstraints(minWidth: 18, minHeight: 18),
+5 -4
View File
@@ -121,7 +121,6 @@ class AppCard extends HookConsumerWidget {
] else ...[
// Default: name and version in same row
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
@@ -135,9 +134,11 @@ class AppCard extends HookConsumerWidget {
),
),
const SizedBox(width: 12),
VersionPillWidget(
app: app!,
showUpdateArrow: showUpdateArrow,
Flexible(
child: VersionPillWidget(
app: app!,
showUpdateArrow: showUpdateArrow,
),
),
],
),
+34 -29
View File
@@ -75,14 +75,16 @@ class VersionPillWidget extends HookConsumerWidget {
mainAxisSize: MainAxisSize.min,
children: [
// Current version pill (muted colors for installed version)
_buildVersionPill(
context,
ref,
installedPackages,
installedVersion,
Theme.of(context).colorScheme.outline.withValues(alpha: 0.3),
Theme.of(context).colorScheme.onSurface,
isInstalledVersion: true,
Flexible(
child: _buildVersionPill(
context,
ref,
installedPackages,
installedVersion,
Theme.of(context).colorScheme.outline.withValues(alpha: 0.3),
Theme.of(context).colorScheme.onSurface,
isInstalledVersion: true,
),
),
// Arrow icon (always arrow, forbidden icon is in the pill itself)
@@ -95,18 +97,20 @@ class VersionPillWidget extends HookConsumerWidget {
),
),
_buildVersionPill(
context,
ref,
installedPackages,
availableVersion,
isDowngrade
? Theme.of(context).colorScheme.outline.withValues(alpha: 0.3)
: AppColors.darkPillBackground,
isDowngrade
? Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5)
: Colors.white,
isDowngrade: isDowngrade,
Flexible(
child: _buildVersionPill(
context,
ref,
installedPackages,
availableVersion,
isDowngrade
? Theme.of(context).colorScheme.outline.withValues(alpha: 0.3)
: AppColors.darkPillBackground,
isDowngrade
? Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5)
: Colors.white,
isDowngrade: isDowngrade,
),
),
],
);
@@ -168,15 +172,16 @@ class VersionPillWidget extends HookConsumerWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
displayVersion,
maxLines: null,
overflow: TextOverflow.visible,
softWrap: true,
style: context.textTheme.labelMedium?.copyWith(
fontWeight: FontWeight.bold,
color: finalTextColor,
fontSize: 11.5,
Flexible(
child: Text(
displayVersion,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: context.textTheme.labelMedium?.copyWith(
fontWeight: FontWeight.bold,
color: finalTextColor,
fontSize: 11.5,
),
),
),
if (statusIcon != null) ...[