feat(receipt-import): enhance package handling with new fields and UI adjustments
This commit is contained in:
@@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user