feat(receipt-import): enhance package handling with new fields and UI adjustments

This commit is contained in:
Nils-Johan Gynther
2026-05-02 10:11:31 +02:00
parent f9dc55d42c
commit 9161de5d52
4 changed files with 251 additions and 78 deletions
@@ -423,26 +423,30 @@ class _UserTile extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(user.email, style: theme.textTheme.bodySmall),
Row(
Wrap(
spacing: 4,
runSpacing: 2,
children: [
Chip(
label: Text(user.role),
ActionChip(
label: Text(user.isAdmin ? 'Admin' : 'User'),
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
labelStyle: theme.textTheme.labelSmall,
tooltip: user.isAdmin ? 'Nedgradera till user' : 'Uppgradera till admin',
onPressed: onChangeRole,
),
if (user.isPremium) ...[
const SizedBox(width: 4),
Chip(
label: const Text('Premium'),
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
labelStyle: theme.textTheme.labelSmall,
backgroundColor: theme.colorScheme.tertiaryContainer,
),
],
const SizedBox(width: 4),
Chip(
ActionChip(
label: Text(user.isPremium ? 'Premium' : 'Free'),
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
labelStyle: theme.textTheme.labelSmall,
backgroundColor: user.isPremium
? theme.colorScheme.tertiaryContainer
: theme.colorScheme.surfaceContainerHighest,
tooltip: user.isPremium ? 'Ta bort Premium' : 'Ge Premium',
onPressed: onTogglePremium,
),
ActionChip(
label: Text(user.canShareRecipes ? 'Delning: På' : 'Delning: Av'),
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
@@ -450,6 +454,8 @@ class _UserTile extends StatelessWidget {
backgroundColor: user.canShareRecipes
? theme.colorScheme.secondaryContainer
: theme.colorScheme.errorContainer,
tooltip: user.canShareRecipes ? 'Blockera receptdelning' : 'Tillåt receptdelning',
onPressed: onToggleRecipeSharing,
),
],
),