Skip to content

Commit

Permalink
fix: Add stronger distinction in list view (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch authored Aug 29, 2023
1 parent b0a05e1 commit 6b8c96a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/cubits/shoppinglist_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ShoppinglistCubit extends Cubit<ShoppinglistCubitState> {
final l = List.of(_state.listItems);
l.remove(item);
final recent = List.of(_state.recentItems);
recent.insert(0, item);
recent.insert(0, ItemWithDescription.fromItem(item: item));
if (recent.length > recentItemCountProvider()) {
recent.removeLast();
}
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/selectable_button_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class SelectableButtonCard extends StatelessWidget {
? Theme.of(context).colorScheme.primary
: ElevationOverlay.applySurfaceTint(
Theme.of(context).cardTheme.color ?? Theme.of(context).cardColor,
Theme.of(context).cardTheme.surfaceTintColor,
1,
Theme.of(context).cardTheme.surfaceTintColor ??
Theme.of(context).colorScheme.surfaceTint,
0,
),
child: InkWell(
onTap: onPressed,
Expand Down
8 changes: 8 additions & 0 deletions lib/widgets/shopping_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ class ShoppingItemWidget<T extends Item> extends StatelessWidget {
)
: Card(
margin: const EdgeInsets.symmetric(vertical: 4),
elevation: item is! ShoppinglistItem ? 0 : null,
color: item is! ShoppinglistItem
? ElevationOverlay.applySurfaceTint(
Theme.of(context).colorScheme.background,
Theme.of(context).colorScheme.surfaceTint,
1.5,
)
: null,
child: ListTile(
leading: selected
? const Icon(Icons.check_rounded)
Expand Down

0 comments on commit 6b8c96a

Please sign in to comment.