Skip to content

Commit

Permalink
Merge pull request #92 from pvdthings/add-item-names-checkout
Browse files Browse the repository at this point in the history
display thing name on items during checkout
  • Loading branch information
dillonfagan authored Nov 16, 2024
2 parents b3e54b5 + 81592dc commit 6ee8652
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ Step buildItemsStep({
GridView.count(
crossAxisCount: 8,
shrinkWrap: true,
childAspectRatio: 1.0 / 1.2,
children: items.map((item) {
return ItemCard(
number: item.number,
name: item.name,
imageUrl: item.imageUrls.firstOrNull,
trailing: IconButton(
icon: const Icon(Icons.remove_circle),
Expand Down
15 changes: 15 additions & 0 deletions apps/librarian/lib/widgets/item_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ class ItemCard extends StatelessWidget {
const ItemCard({
super.key,
required this.number,
this.name,
this.imageUrl,
this.notes,
this.trailing,
this.onTap,
});

final int number;
final String? name;
final String? imageUrl;
final String? notes;
final Widget? trailing;
Expand Down Expand Up @@ -65,6 +67,19 @@ class ItemCard extends StatelessWidget {
],
),
),
if (name != null)
Padding(
padding: const EdgeInsets.only(
left: 8.0,
right: 8.0,
bottom: 8.0,
),
child: Text(
name!,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.labelSmall,
),
),
],
),
),
Expand Down

0 comments on commit 6ee8652

Please sign in to comment.